Skip to content

Commit aff2449

Browse files
committed
change flaky test mechanism; now looks for file in root
1 parent be93663 commit aff2449

72 files changed

Lines changed: 3 additions & 11 deletions

Some content is hidden

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

‎test/comparison-tests/create-and-execute-test.js‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ var rootPathWithIncorrectWindowsSeparator = rootPath.replace(/\\/g, '/');
3434
var stagingPath = path.resolve(rootPath, '.test');
3535

3636
var testPath = path.join(__dirname, testToRun);
37+
var testIsFlaky = pathExists(path.join(testPath, FLAKY));
3738
if (fs.statSync(testPath).isDirectory()) {
3839

3940
if (testToRun == 'testLib') return;
@@ -44,7 +45,7 @@ if (fs.statSync(testPath).isDirectory()) {
4445
it('should have the correct output', createTest(testToRun, testPath, {}));
4546

4647
if (testToRun == 'declarationOutput') { return; }
47-
if (testToRun == '_FLAKY_declarationWatch') { return; }
48+
if (testToRun == 'declarationWatch') { return; }
4849
if (testToRun == 'issue71') { return; }
4950
it('should work with transpile', createTest(testToRun, testPath, { transpile: true }));
5051
});
@@ -279,11 +280,6 @@ function getNormalisedFileContent(file, location, test) {
279280
fileContent = fileContent
280281
.replace(new RegExp(regexEscape('/'), 'g'), '\\')
281282
.replace(new RegExp(regexEscape('\\'), 'g'), '/');
282-
283-
// ignore flaky in the output.txt paths
284-
if (testIsFlaky(test)) {
285-
fileContent = fileContent.replace(new RegExp(regexEscape(FLAKY), 'g'), '');
286-
}
287283
}
288284
}
289285
catch (e) {
@@ -299,7 +295,7 @@ function getNormalisedFileContent(file, location, test) {
299295
function compareActualAndExpected(test, actual, expected, patch, file) {
300296
const actualString = actual.toString();
301297
const expectedString = expected.toString();
302-
if (testIsFlaky(test)) {
298+
if (testIsFlaky) {
303299
try {
304300
assert.equal(actualString, expectedString, (patch ? patch + '/' : patch) + file + ' is different between actual and expected');
305301
}
@@ -314,7 +310,3 @@ function compareActualAndExpected(test, actual, expected, patch, file) {
314310
assert.equal(actualString, expectedString, (patch ? patch + '/' : patch) + file + ' is different between actual and expected');
315311
}
316312
}
317-
318-
function testIsFlaky(testName) {
319-
return testName.indexOf(FLAKY) === 0;
320-
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

test/comparison-tests/_FLAKY_declarationWatch/expectedOutput-1.6/bundle.js renamed to test/comparison-tests/declarationWatch/expectedOutput-1.6/bundle.js

File renamed without changes.

test/comparison-tests/_FLAKY_declarationWatch/expectedOutput-1.6/output.txt renamed to test/comparison-tests/declarationWatch/expectedOutput-1.6/output.txt

File renamed without changes.

test/comparison-tests/_FLAKY_declarationWatch/expectedOutput-1.6/patch0/bundle.js renamed to test/comparison-tests/declarationWatch/expectedOutput-1.6/patch0/bundle.js

File renamed without changes.

test/comparison-tests/_FLAKY_declarationWatch/expectedOutput-1.6/patch0/output.txt renamed to test/comparison-tests/declarationWatch/expectedOutput-1.6/patch0/output.txt

File renamed without changes.

test/comparison-tests/_FLAKY_declarationWatch/expectedOutput-1.6/patch1/bundle.js renamed to test/comparison-tests/declarationWatch/expectedOutput-1.6/patch1/bundle.js

File renamed without changes.

test/comparison-tests/_FLAKY_declarationWatch/expectedOutput-1.6/patch1/output.txt renamed to test/comparison-tests/declarationWatch/expectedOutput-1.6/patch1/output.txt

File renamed without changes.

0 commit comments

Comments
 (0)