Skip to content

Commit f036ee3

Browse files
committed
Merge pull request #54 from stkb/tests-fix
Fix testing code to check all tests, not just the last
2 parents 239bc71 + c1a13a9 commit f036ee3

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

tests/test.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ describe("Compare generated with baselines", () => {
1414
for (var file of fs.readdirSync('generated')) {
1515
var generatedText = fs.readFileSync('generated/' + file, 'utf8');
1616
var baselinesText = fs.readFileSync('baselines/' + file, 'utf8');
17-
describe('Comparing ' + file, () => {
18-
it('should be the same', () => {
19-
chai.expect(compareText(generatedText, baselinesText)).to.true;
20-
})
21-
})
17+
18+
addTestCase(file, generatedText, baselinesText);
2219
}
23-
})
20+
})
21+
22+
function addTestCase(file: string, generatedText: string, baselinesText: string) {
23+
describe('Comparing ' + file, () => {
24+
it('should be the same', () => {
25+
chai.expect(compareText(generatedText, baselinesText)).to.true;
26+
})
27+
})
28+
}

0 commit comments

Comments
 (0)