Skip to content

Commit 86094e3

Browse files
committed
QUnit support
1 parent d757116 commit 86094e3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

main-view-model.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,12 @@ export class TestBrokerViewModel extends observable.Observable {
371371
global.require = function() {
372372
throw Error();
373373
}
374-
375374
global.window = global;
375+
} else if (url.indexOf('qunit.js') !== -1) {
376+
global.define = function (factory) {
377+
global.QUnit = factory();
378+
}
379+
global.define.amd = true;
376380
}
377381
}
378382

@@ -381,6 +385,8 @@ export class TestBrokerViewModel extends observable.Observable {
381385
delete global.window;
382386
global.require = global.__shim_require;
383387
delete global.__shim_require;
388+
} else if (url.indexOf('qunit.js') !== -1) {
389+
delete global.define;
384390
}
385391
}
386392
}

0 commit comments

Comments
 (0)