Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
fix(onPrepare): onPrepare with a string argument should resolve from …
Browse files Browse the repository at this point in the history
…the config directory

onPrepare can take a string, which is a filename containing a script to load adn execute
before any tests run. This fixes the string to resolve the filename relative to the
config file, instead of relative to the current working directory where protractor
is called.
  • Loading branch information
juliemr committed Oct 27, 2013
1 parent 267d49d commit 8c87ae6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ var runJasmineTests = function() {
if (typeof config.onPrepare == 'function') {
config.onPrepare();
} else if (typeof config.onPrepare == 'string') {
require(path.resolve(process.cwd(), config.onPrepare));
require(path.resolve(config.specFileBase, config.onPrepare));
} else {
throw 'config.onPrepare must be a string or function';
}
Expand Down

0 comments on commit 8c87ae6

Please sign in to comment.