-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved the implementation of
expectAssertion
to handle assertions…
… thrown inside of a runloop during an integration test. Related to: emberjs/ember.js#14898 .
- Loading branch information
Showing
7 changed files
with
65 additions
and
11 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import Ember from 'ember'; | ||
import { test } from 'ember-qunit'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
import moduleForAssert from '../helpers/module-for-assert'; | ||
|
||
|
||
moduleForAssert('Integration: Assertion', { | ||
integration: true, | ||
beforeEach() { | ||
this.register('component:x-assert-test', Ember.Component.extend({ | ||
init() { | ||
this._super(); | ||
Ember.assert('x-assert-test will always assert'); | ||
} | ||
})); | ||
} | ||
}); | ||
|
||
test('Check for assert', function(assert) { | ||
assert.expectAssertion(() => { | ||
this.render(hbs`{{x-assert-test}}`); | ||
}, /x-assert-test will always assert/); | ||
|
||
// Restore the asserts (removes the mocking) | ||
this.restoreAsserts(); | ||
|
||
assert.ok(this.pushedResults[0].result, '`expectWarning` captured warning call'); | ||
}); |
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
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