Skip to content

Commit 105c780

Browse files
committed
moved comparison tests to comparison-tests folder
in preparation for adding some execution tests
1 parent 9482255 commit 105c780

File tree

794 files changed

+31
-27
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

794 files changed

+31
-27
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"main": "index.js",
66
"scripts": {
77
"build": "tsc",
8-
"comparison-tests": "npm link ./test/testLib && mocha --reporter spec test/run.js",
9-
"test": "npm link ./test/testLib && node test/run-tests-as-child.js ",
8+
"test": "npm link ./test/comparison-tests/testLib && node test/comparison-tests/run-tests.js ",
109
"prepublish": "npm run build"
1110
},
1211
"repository": {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

test/run.js renamed to test/comparison-tests/create-and-execute-test.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ require('colors').enabled = true;
1616
var saveOutputMode = process.argv.indexOf('--save-output') !== -1;
1717
var excludeVersions = process.argv.indexOf('--exclude-versions') !== -1;
1818

19-
var indexOfSingleTest = process.argv.indexOf('--single-test');
20-
var singleTestToRun = indexOfSingleTest !== -1 && process.argv[indexOfSingleTest + 1];
19+
var testToRun = process.argv[process.argv.length - 1];
2120

2221
var savedOutputs = {};
2322

@@ -33,28 +32,26 @@ if (saveOutputMode) {
3332
var typescriptVersion = semver.major(typescript.version) + '.' + semver.minor(typescript.version);
3433
var FLAKY = '_FLAKY_';
3534

36-
// set up new empty staging area
37-
var rootPath = path.resolve(__dirname, '..');
35+
// set up new paths
36+
var rootPath = path.resolve(__dirname, '../../');
3837
var rootPathWithIncorrectWindowsSeparator = rootPath.replace(/\\/g, '/');
3938
var stagingPath = path.resolve(rootPath, '.test');
40-
rimraf.sync(stagingPath);
4139

4240
// loop through each test directory
43-
var test = singleTestToRun;
44-
var testPath = path.join(__dirname, test);
41+
var testPath = path.join(__dirname, testToRun);
4542
if (fs.statSync(testPath).isDirectory()) {
4643

47-
if (test == 'testLib') return;
44+
if (testToRun == 'testLib') return;
4845

49-
if (test == 'issue81' && semver.lt(typescript.version, '1.7.0-0')) return;
46+
if (testToRun == 'issue81' && semver.lt(typescript.version, '1.7.0-0')) return;
5047

51-
describe(test, function () {
52-
it('should have the correct output', createTest(test, testPath, {}));
48+
describe(testToRun, function () {
49+
it('should have the correct output', createTest(testToRun, testPath, {}));
5350

54-
if (test == 'declarationOutput') { return; }
55-
if (test == 'declarationWatch') { return; }
56-
if (test == 'issue71') { return; }
57-
it('should work with transpile', createTest(test, testPath, { transpile: true }));
51+
if (testToRun == 'declarationOutput') { return; }
52+
if (testToRun == 'declarationWatch') { return; }
53+
if (testToRun == 'issue71') { return; }
54+
it('should work with transpile', createTest(testToRun, testPath, { transpile: true }));
5855
});
5956
}
6057

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{
2-
"files": [
3-
"./references.d.ts"
4-
]
5-
}
1+
{
2+
"files": [
3+
"./references.d.ts"
4+
]
5+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)