mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 18:06:44 +00:00
Move index.js to frontend_tests/zjsunit.
This commit is contained in:
@@ -19,7 +19,11 @@ if (process.argv[2] ) {
|
|||||||
.map(function (filename) {return filename.replace(/\.js$/i, '');});
|
.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);})
|
.filter(function (filename) {return (/\.js$/i).test(filename);})
|
||||||
.map(function (filename) {return filename.replace(/\.js$/i, '');});
|
.map(function (filename) {return filename.replace(/\.js$/i, '');});
|
||||||
|
|
||||||
@@ -184,11 +188,8 @@ global.append_test_output = function (output) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
tests.forEach(function (filename) {
|
tests.forEach(function (filename) {
|
||||||
if (filename === 'index') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.info('running tests for ' + filename);
|
console.info('running tests for ' + filename);
|
||||||
require('./' + filename);
|
require(path.join(tests_dir, filename));
|
||||||
|
|
||||||
dependencies.forEach(function (name) {
|
dependencies.forEach(function (name) {
|
||||||
delete global[name];
|
delete global[name];
|
||||||
@@ -5,7 +5,7 @@ cd "$(dirname "$0")"/..
|
|||||||
|
|
||||||
export NODE_PATH=/usr/lib/nodejs:static
|
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)
|
NODEJS=$(which nodejs || which node)
|
||||||
if [ "$1" = "cover" ]; then
|
if [ "$1" = "cover" ]; then
|
||||||
# Run a coverage test with Istanbul.
|
# Run a coverage test with Istanbul.
|
||||||
|
|||||||
Reference in New Issue
Block a user