Behat を Zombie.js で動作させるには、問題が次々と発生しています。私が今抱えている問題は、実際には Zombie.js モジュール内にあります (以前は、エラーは 2 つの間のリンクにありました)。
エラーはそのように見えます。
[RuntimeException]
Server process has been terminated: (8) [
url.js:107
throw new TypeError("Parameter 'url' must be a string, not " + typeof url)
^
TypeError: Parameter 'url' must be a string, not undefined
at Url.parse (url.js:107:11)
at urlParse (url.js:101:5)
at Object.urlResolve [as resolve] (url.js:405:10)
at History._resolve (/Users/nathanielh/www/website/node_modules/zombie/lib/zombie/history.coffee:201:20)
at History._assign (/Users/nathanielh/www/website/node_modules/zombie/lib/zombie/history.coffee:209:18)
at /Users/nathanielh/www/website/node_modules/zombie/lib/zombie/browser.coffee:326:30
at Browser.withOptions (/Users/nathanielh/www/website/node_modules/zombie/lib/zombie/browser.coffee:105:14)
at Browser.visit (/Users/nathanielh/www/website/node_modules/zombie/lib/zombie/browser.coffee:320:12)
at Socket.eval (eval at <anonymous> (/private/var/folders/fv/fp4xrfnx7kzfq2bqzywq5p9w00010f/T/mink_nodejs_serverSZBH0W:43:10), <anonymous>:2:9)
at Socket.<anonymous> (/private/var/folders/fv/fp4xrfnx7kzfq2bqzywq5p9w00010f/T/mink_nodejs_serverSZBH0W:43:5)
]
history.coffee
で、resolve
関数が存在しない配列要素を使用しようとしていることがわかりました。
// history.coffee
_resolve: (url)->
if url
return URL.resolve(@_stack[@_index]?.url, url)
else # Yes, this could happen
return @_stack[@_index]?.url
へのその参照@_stack[@_index]
は undefined に解決され、それが に渡されURL.resolve
、エラーが発生します。
なぜこれが起こるのでしょうか?
アップデート
@_stack
が空で、 で@_index
あることに気付きました-1
。これは不可能ですよね?