You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR RangeError: Maximum call stack size exceeded
at Object.CliRunner.replaceEnvVariables (/Users/cjeske/tmp/nightwatch/lib/runner/cli/clirunner.js:111:33)
at Object.CliRunner.replaceEnvVariables (/Users/cjeske/tmp/nightwatch/lib/runner/cli/clirunner.js:116:14)
at Object.CliRunner.replaceEnvVariables (/Users/cjeske/tmp/nightwatch/lib/runner/cli/clirunner.js:116:14)
at Object.CliRunner.replaceEnvVariables (/Users/cjeske/tmp/nightwatch/lib/runner/cli/clirunner.js:116:14)
at Object.CliRunner.replaceEnvVariables (/Users/cjeske/tmp/nightwatch/lib/runner/cli/clirunner.js:116:14)
at Object.CliRunner.replaceEnvVariables (/Users/cjeske/tmp/nightwatch/lib/runner/cli/clirunner.js:116:14)
at Object.CliRunner.replaceEnvVariables (/Users/cjeske/tmp/nightwatch/lib/runner/cli/clirunner.js:116:14)
at Object.CliRunner.replaceEnvVariables (/Users/cjeske/tmp/nightwatch/lib/runner/cli/clirunner.js:116:14)
at Object.CliRunner.replaceEnvVariables (/Users/cjeske/tmp/nightwatch/lib/runner/cli/clirunner.js:116:14)
at Object.CliRunner.replaceEnvVariables (/Users/cjeske/tmp/nightwatch/lib/runner/cli/clirunner.js:116:14)
There was an error while starting the test runner:
Error: No testing environment specified.
at Object.CliRunner.parseTestSettings
(/Users/cjeske/tmp/nightwatch/lib/runner/cli/clirunner.js:516:13)
at Object.CliRunner.setup (/Users/cjeske/tmp/nightwatch/lib/runner/cli/clirunner.js:49:8)
at Object.exports.runner (/Users/cjeske/tmp/nightwatch/lib/index.js:543:17)
at /Users/cjeske/tmp/nightwatch/bin/runner.js:11:16
at Object.exports.cli (/Users/cjeske/tmp/nightwatch/lib/index.js:537:5)
at Object.<anonymous> (/Users/cjeske/tmp/nightwatch/bin/runner.js:9:14)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
When used this config: { "foobar": "" }
The result is correct:
There was an error while starting the test runner:
Error: No testing environment specified.
at Object.CliRunner.parseTestSettings (/Users/cjeske/tmp/nightwatch/lib/runner/cli/clirunner.js:516:13)
at Object.CliRunner.setup (/Users/cjeske/tmp/nightwatch/lib/runner/cli/clirunner.js:49:8)
at Object.exports.runner (/Users/cjeske/tmp/nightwatch/lib/index.js:543:17)
at /Users/cjeske/tmp/nightwatch/bin/runner.js:11:16
at Object.exports.cli (/Users/cjeske/tmp/nightwatch/lib/index.js:537:5)
at Object.<anonymous> (/Users/cjeske/tmp/nightwatch/bin/runner.js:9:14)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
The reason for all this is because typeof null === 'object'
and the recursive function in lib/runner/cli/clirunner.js:112 does a not typesecure check, if the given parameter is undefined.
Because of that, it starts over again and sets target to this.settings again. When iterating over it, it goes to the key foobar and it sees a object and calls itself with null and everything starts all over again.
nightwatch.json:
{ "foobar": null }
Verbose:
When used this config:
{ "foobar": "" }
The result is correct:
The reason for all this is because
typeof null === 'object'
and the recursive function in lib/runner/cli/clirunner.js:112 does a not typesecure check, if the given parameter is undefined.
Because of that, it starts over again and sets target to this.settings again. When iterating over it, it goes to the key foobar and it sees a object and calls itself with null and everything starts all over again.
Fixed in #1292
The text was updated successfully, but these errors were encountered: