Move index.js to frontend_tests/zjsunit.

This commit is contained in:
Steve Howell
2016-07-30 07:43:28 -07:00
committed by Tim Abbott
parent f0bf883772
commit 6a65b3482c
2 changed files with 7 additions and 6 deletions

View File

@@ -19,7 +19,11 @@ if (process.argv[2] ) {
.map(function (filename) {return filename.replace(/\.js$/i, '');});
}
var tests = fs.readdirSync(__dirname)
// tests_dir is where we find our specific unit tests (as opposed
// to framework code)
var tests_dir = __dirname.replace(/zjsunit/, 'node_tests');
var tests = fs.readdirSync(tests_dir)
.filter(function (filename) {return (/\.js$/i).test(filename);})
.map(function (filename) {return filename.replace(/\.js$/i, '');});
@@ -184,11 +188,8 @@ global.append_test_output = function (output) {
};
tests.forEach(function (filename) {
if (filename === 'index') {
return;
}
console.info('running tests for ' + filename);
require('./' + filename);
require(path.join(tests_dir, filename));
dependencies.forEach(function (name) {
delete global[name];

View File

@@ -5,7 +5,7 @@ cd "$(dirname "$0")"/..
export NODE_PATH=/usr/lib/nodejs:static
INDEX_JS=frontend_tests/node_tests/index.js
INDEX_JS=frontend_tests/zjsunit/index.js
NODEJS=$(which nodejs || which node)
if [ "$1" = "cover" ]; then
# Run a coverage test with Istanbul.