File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,10 @@ import { wrapTest, commonConfig } from './utils/config';
6
6
commonConfig ( ) ;
7
7
8
8
export default function only ( testName , callback ) {
9
- deprecate ( 'This pattern is now deprecated. Please import the `setupSinon` method instead.' , {
10
- id : 'ember-sinon-qunit.only'
9
+ deprecate ( 'This pattern is now deprecated. Please import the `setupSinon` method instead.' , false , {
10
+ id : 'ember-sinon-qunit.only' ,
11
+ until : '5.0.0' ,
12
+ url : 'https://github.com/elwayman02/ember-sinon-qunit#migration-from-older-versions-of-ember-sinon-qunit'
11
13
} ) ;
12
14
wrapTest ( testName , callback , emberQUnitOnly ) ;
13
15
}
Original file line number Diff line number Diff line change @@ -6,8 +6,10 @@ import { wrapTest, commonConfig } from './utils/config';
6
6
commonConfig ( ) ;
7
7
8
8
export default function test ( testName , callback ) {
9
- deprecate ( 'This pattern is now deprecated. Please import the `setupSinon` method instead.' , {
10
- id : 'ember-sinon-qunit.test'
9
+ deprecate ( 'This pattern is now deprecated. Please import the `setupSinon` method instead.' , false , {
10
+ id : 'ember-sinon-qunit.test' ,
11
+ until : '5.0.0' ,
12
+ url : 'https://github.com/elwayman02/ember-sinon-qunit#migration-from-older-versions-of-ember-sinon-qunit'
11
13
} ) ;
12
14
wrapTest ( testName , callback , emberQUnitTest ) ;
13
15
}
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import { module } from 'qunit';
2
2
import { resolve } from 'rsvp' ;
3
3
import test from 'ember-sinon-qunit/test-support/test' ;
4
4
import assertSinonInTestContext from '../helpers/assert-sinon-in-test-context' ;
5
+ import Ember from 'ember' ;
6
+ import sinon from 'sinon' ;
5
7
6
8
let fooValue = 42 ;
7
9
let origMethod ;
@@ -24,10 +26,21 @@ module('Deprecated | Unit | ember-sinon-qunit', {
24
26
25
27
assertSinonInTestContext ( test ) ;
26
28
29
+ const deprecateStub = sinon . stub ( Ember , 'deprecate' ) . callsFake ( function ( unused , deprecateTest ) {
30
+ if ( deprecateTest !== false ) {
31
+ throw new Error ( 'Ember.deprecate should be called with 2nd argument `false`' ) ;
32
+ }
33
+ } ) ;
34
+
27
35
test ( 'does not destroy context from beforeEach' , function ( assert ) {
28
36
assert . equal ( this . foo , fooValue ) ;
29
37
} ) ;
30
38
39
+ if ( ! deprecateStub . called ) {
40
+ throw new Error ( 'Ember.deprecate should be called' ) ;
41
+ }
42
+ deprecateStub . restore ( ) ;
43
+
31
44
test ( 'async with assert.async()' , function ( assert ) {
32
45
assert . expect ( 2 ) ;
33
46
this . stub ( obj , 'method' ) ;
You can’t perform that action at this time.
0 commit comments