@@ -47,25 +47,6 @@ moduleFor(
47
47
'passed-property' ,
48
48
'passed property available on instance (create)'
49
49
) ;
50
- calls = [ ] ;
51
- myObject = new MyObject ( { passedProperty : 'passed-property' } ) ;
52
-
53
- assert . deepEqual ( calls , [ 'constructor' , 'init' ] , 'constructor then init called (new)' ) ;
54
- assert . equal (
55
- myObject . postInitProperty ,
56
- 'post-init-property' ,
57
- 'constructor property available on instance (new)'
58
- ) ;
59
- assert . equal (
60
- myObject . initProperty ,
61
- 'init-property' ,
62
- 'init property available on instance (new)'
63
- ) ;
64
- assert . equal (
65
- myObject . passedProperty ,
66
- 'passed-property' ,
67
- 'passed property available on instance (new)'
68
- ) ;
69
50
}
70
51
71
52
[ '@test normal method super' ] ( assert ) {
@@ -116,7 +97,7 @@ moduleFor(
116
97
117
98
[ Foo , Bar , Baz , Qux , Quux , Corge ] . forEach ( ( Class , index ) => {
118
99
calls = [ ] ;
119
- new Class ( ) . method ( ) ;
100
+ Class . create ( ) . method ( ) ;
120
101
121
102
assert . deepEqual (
122
103
calls ,
@@ -199,22 +180,18 @@ moduleFor(
199
180
200
181
class MyObject extends EmberObject . extend ( Mixin1 , Mixin2 ) { }
201
182
202
- let myObject = new MyObject ( ) ;
183
+ let myObject = MyObject . create ( ) ;
203
184
assert . equal ( myObject . property1 , 'data-1' , 'includes the first mixin' ) ;
204
185
assert . equal ( myObject . property2 , 'data-2' , 'includes the second mixin' ) ;
205
186
}
206
187
207
188
[ '@test using instanceof' ] ( assert ) {
208
189
class MyObject extends EmberObject { }
209
190
210
- let myObject1 = MyObject . create ( ) ;
211
- let myObject2 = new MyObject ( ) ;
191
+ let myObject = MyObject . create ( ) ;
212
192
213
- assert . ok ( myObject1 instanceof MyObject ) ;
214
- assert . ok ( myObject1 instanceof EmberObject ) ;
215
-
216
- assert . ok ( myObject2 instanceof MyObject ) ;
217
- assert . ok ( myObject2 instanceof EmberObject ) ;
193
+ assert . ok ( myObject instanceof MyObject ) ;
194
+ assert . ok ( myObject instanceof EmberObject ) ;
218
195
}
219
196
220
197
[ '@test extending an ES subclass of EmberObject' ] ( assert ) {
@@ -236,10 +213,6 @@ moduleFor(
236
213
237
214
MyObject . create ( ) ;
238
215
assert . deepEqual ( calls , [ 'constructor' , 'init' ] , 'constructor then init called (create)' ) ;
239
-
240
- calls = [ ] ;
241
- new MyObject ( ) ;
242
- assert . deepEqual ( calls , [ 'constructor' , 'init' ] , 'constructor then init called (new)' ) ;
243
216
}
244
217
245
218
[ '@test calling extend on an ES subclass of EmberObject' ] ( assert ) {
@@ -268,14 +241,6 @@ moduleFor(
268
241
'constructor then init called (create)'
269
242
) ;
270
243
271
- calls = [ ] ;
272
- new MyObject ( ) ;
273
- assert . deepEqual (
274
- calls ,
275
- [ 'before constructor' , 'init' , 'after constructor' ] ,
276
- 'constructor then init called (new)'
277
- ) ;
278
-
279
244
let obj = MyObject . create ( {
280
245
foo : 456 ,
281
246
bar : 789 ,
0 commit comments