Skip to content

Commit

Permalink
use test/harness as helper dir if present
Browse files Browse the repository at this point in the history
  • Loading branch information
smikes committed Oct 24, 2014
1 parent c2766c2 commit 46b0483
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@

var fs = require('fs');
var parseFile = require('test262-parser').parseFile;
var helperDir = __dirname + '/helpers/';

fs.readdirSync(__dirname + '/helpers')
if (fs.existsSync('test/harness')) {
helperDir = 'test/harness/';
}

fs.readdirSync(helperDir)
.forEach(function(file) {
exports[file] =
parseFile({contents: fs.readFileSync(__dirname + '/helpers/' + file, 'utf-8'), file: file});
parseFile({contents: fs.readFileSync(helperDir + file, 'utf-8'), file: file});
});

0 comments on commit 46b0483

Please sign in to comment.