Skip to content

Commit 49334bf

Browse files
scottgonzalezjzaefferer
authored andcommitted
Server: Add AMD support to QUnit patch file
Closes #115
1 parent 56134e2 commit 49334bf

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/_patch/qunit-plugin.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
// For logging assertions on the console, here's what grunt-contrib-qunit uses:
22
// https://github.com/gruntjs/grunt-contrib-qunit/blob/784597023e7235337ca9c0651aa45124a2d72341/tasks/qunit.js#L45
3-
(function() {
4-
3+
(function (factory) {
4+
if (typeof define === 'function' && define.amd) {
5+
require(['qunit'], factory);
6+
} else {
7+
factory(QUnit);
8+
}
9+
}(function(QUnit) {
510
var failedAssertions = [];
611
var options,
712
currentModule,
@@ -54,5 +59,4 @@
5459
results.url = window.location.pathname;
5560
BrowserStack.post("/_report", results, function(){});
5661
});
57-
58-
})();
62+
}));

0 commit comments

Comments
 (0)