Skip to content

Commit

Permalink
Merge pull request #511 from lddubeau/fix/test-count
Browse files Browse the repository at this point in the history
Fix the way tests are counted.
  • Loading branch information
ivogabe authored May 25, 2017
2 parents 348743c + 79dac8e commit e3f7e29
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,15 @@ gulp.task('typecheck', [/* 'typecheck-1.4', 'typecheck-1.5', 'typecheck-1.6', */

// Tests

// We run every test on multiple typescript versions:
var libs = [
['2.0', undefined],
['dev', require(tsVersions.dev)]
];

// helper function for running a test.
function runTest(name, callback) {
var newTS = require('./release-2/main');
// We run every test on multiple typescript versions:
var libs = [
['2.0', undefined],
['dev', require(tsVersions.dev)]
];
var test = require('./test/' + name + '/gulptask.js');

var done = 0;
Expand Down Expand Up @@ -154,7 +155,7 @@ function runTest(name, callback) {
gulp.task('test-run', ['clean-test', 'scripts'], function(cb) {
fs.mkdirSync('test/output/');

var pending = tests.length;
var pending = tests.length * libs.length;
if (pending === 0) {
cb();
return;
Expand All @@ -172,6 +173,10 @@ gulp.task('test-run', ['clean-test', 'scripts'], function(cb) {
cb();
}
}
// This allows catching possible counting errors.
else if (pending < 0) {
throw new Error('Callback called more than expected!');
}
});
}
})
Expand Down

0 comments on commit e3f7e29

Please sign in to comment.