Skip to content

Commit

Permalink
Add support for query parameters "noglobal" and "notrycatch".
Browse files Browse the repository at this point in the history
Closes jonkemp#22.
  • Loading branch information
lehni committed Jan 16, 2016
1 parent 06de8c9 commit 459c560
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,25 @@ module.exports = function (params) {
return through.obj(function (file, enc, cb) {
var absolutePath = path.resolve(file.path),
isAbsolutePath = absolutePath.indexOf(file.path) >= 0,
queryParams = [],
childArgs = [];

if (options.noGlobals) {
queryParams.push('noglobals');
}

if (options.noTryCatch) {
queryParams.push('notrycatch');
}

if (options['phantomjs-options'] && options['phantomjs-options'].length) {
childArgs.push(options['phantomjs-options']);
}

childArgs.push(
require.resolve('qunit-phantomjs-runner'),
(isAbsolutePath ? 'file:///' + absolutePath.replace(/\\/g, '/') : file.path)
(isAbsolutePath ? 'file:///' + absolutePath.replace(/\\/g, '/') : file.path) +
(queryParams.length ? '?' + queryParams.join('&') : '')
);

if (options.timeout) {
Expand Down

0 comments on commit 459c560

Please sign in to comment.