-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #234 from trentmwillis/qunit-2
Upgrade QUnit to 2.0
- Loading branch information
Showing
15 changed files
with
140 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
import moduleFor from 'ember-qunit/module-for'; | ||
import moduleForComponent from 'ember-qunit/module-for-component'; | ||
import moduleForModel from 'ember-qunit/module-for-model'; | ||
import test from 'ember-qunit/test'; | ||
import only from 'ember-qunit/only'; | ||
import skip from 'ember-qunit/skip'; | ||
import { setResolver } from 'ember-test-helpers'; | ||
import moduleFor from 'ember-qunit/module-for'; | ||
import moduleForComponent from 'ember-qunit/module-for-component'; | ||
import moduleForModel from 'ember-qunit/module-for-model'; | ||
import QUnitAdapter from 'ember-qunit/adapter'; | ||
import { setResolver } from 'ember-test-helpers'; | ||
export { test, skip, only } from 'qunit'; | ||
|
||
export { | ||
moduleFor, | ||
moduleForComponent, | ||
moduleForModel, | ||
test, | ||
only, | ||
skip, | ||
setResolver | ||
setResolver, | ||
QUnitAdapter | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import Ember from 'ember'; | ||
import QUnit from 'qunit'; | ||
|
||
export default Ember.Test.Adapter.extend({ | ||
init() { | ||
this.doneCallbacks = []; | ||
}, | ||
|
||
asyncStart() { | ||
this.doneCallbacks.push(QUnit.config.current.assert.async()); | ||
}, | ||
|
||
asyncEnd() { | ||
this.doneCallbacks.pop()(); | ||
}, | ||
|
||
exception(error) { | ||
QUnit.config.current.assert.ok(false, Ember.inspect(error)); | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* globals test:true */ | ||
/* globals QUnit */ | ||
|
||
export var module = QUnit.module; | ||
export var test = QUnit.test; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* global setTimeout */ | ||
|
||
import { module, test } from 'qunit'; | ||
import { QUnitAdapter } from 'ember-qunit'; | ||
|
||
module('QUnitAdapter'); | ||
|
||
test('asyncStart waits for asyncEnd to finish a test', function(assert) { | ||
const adapter = QUnitAdapter.create(); | ||
|
||
adapter.asyncStart(); | ||
setTimeout(function() { | ||
assert.ok(true); | ||
adapter.asyncEnd(); | ||
}, 50); | ||
}); | ||
|
||
test('asyncStart waits for equal numbers of asyncEnd to finish a test', function(assert) { | ||
const adapter = QUnitAdapter.create(); | ||
|
||
adapter.asyncStart(); | ||
adapter.asyncStart(); | ||
adapter.asyncEnd(); | ||
|
||
setTimeout(function() { | ||
assert.ok(true); | ||
adapter.asyncEnd(); | ||
}, 50); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.