Skip to content

Commit 4212f8d

Browse files
committed
Bump qunitjs version to 2.1.1
This is a major upgrade. The deprecated globals are no longer supported as of QUnit 2.0. Update child.js to work with the new QUnit API. * Migrate testrunner to use assert.async() instead of stop/start. * Remove forwarding of 'expected' and 'async' parameters. * Remove expect numbers from async-test.js.
1 parent 513c75f commit 4212f8d

3 files changed

Lines changed: 10 additions & 15 deletions

File tree

lib/child.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,29 +113,24 @@ if (generators.support) {
113113
/**
114114
* Support generators.
115115
*/
116-
global.test = QUnit.test = function(testName, expected, callback, async) {
116+
global.test = QUnit.test = function(testName, callback) {
117117
var fn;
118118

119-
if (arguments.length === 2) {
120-
callback = expected;
121-
expected = null;
122-
}
123-
124119
if (generators.isGeneratorFn(callback)) {
125120
fn = function(assert) {
126-
stop();
121+
var done = assert.async();
127122
co.wrap(callback).call(this, assert).then(function() {
128-
start();
123+
done();
129124
}).catch(function (err) {
130125
console.log(err.stack);
131-
start();
126+
done();
132127
});
133128
};
134129
} else {
135130
fn = callback;
136131
}
137132

138-
return test.call(this, testName, expected, fn, async);
133+
return test.call(this, testName, fn);
139134
};
140135
}
141136

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"argsparser": "^0.0.7",
4242
"cli-table": "^0.3.0",
4343
"co": "^4.6.0",
44-
"qunitjs": "1.23.1",
44+
"qunitjs": "2.1.1",
4545
"tracejs": "^0.1.8",
4646
"underscore": "^1.6.0"
4747
},

test/fixtures/async-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
test('1', 1, function (assert){
1+
test('1', function (assert){
22
assert.ok(true, "tests intermixing sync and async tests #1");
33
});
44

5-
test('a', 2, function(assert){
5+
test('a', function(assert){
66
var done = assert.async();
77

88
setTimeout(function() {
@@ -12,11 +12,11 @@ test('a', 2, function(assert){
1212
}, 100);
1313
});
1414

15-
test('2', 1, function (assert){
15+
test('2', function (assert){
1616
assert.ok(true, "tests intermixing sync and async tests #2");
1717
});
1818

19-
test('b', 2, function(assert){
19+
test('b', function(assert){
2020
var done = assert.async();
2121

2222
setTimeout(function() {

0 commit comments

Comments
 (0)