@@ -40,25 +40,6 @@ moduleFor(
40
40
'passed-property' ,
41
41
'passed property available on instance (create)'
42
42
) ;
43
- calls = [ ] ;
44
- myObject = new MyObject ( { passedProperty : 'passed-property' } ) ;
45
-
46
- assert . deepEqual ( calls , [ 'constructor' , 'init' ] , 'constructor then init called (new)' ) ;
47
- assert . equal (
48
- myObject . postInitProperty ,
49
- 'post-init-property' ,
50
- 'constructor property available on instance (new)'
51
- ) ;
52
- assert . equal (
53
- myObject . initProperty ,
54
- 'init-property' ,
55
- 'init property available on instance (new)'
56
- ) ;
57
- assert . equal (
58
- myObject . passedProperty ,
59
- 'passed-property' ,
60
- 'passed property available on instance (new)'
61
- ) ;
62
43
}
63
44
64
45
[ '@test normal method super' ] ( assert ) {
@@ -109,7 +90,7 @@ moduleFor(
109
90
110
91
[ Foo , Bar , Baz , Qux , Quux , Corge ] . forEach ( ( Class , index ) => {
111
92
calls = [ ] ;
112
- new Class ( ) . method ( ) ;
93
+ Class . create ( ) . method ( ) ;
113
94
114
95
assert . deepEqual (
115
96
calls ,
@@ -192,22 +173,18 @@ moduleFor(
192
173
193
174
class MyObject extends EmberObject . extend ( Mixin1 , Mixin2 ) { }
194
175
195
- let myObject = new MyObject ( ) ;
176
+ let myObject = MyObject . create ( ) ;
196
177
assert . equal ( myObject . property1 , 'data-1' , 'includes the first mixin' ) ;
197
178
assert . equal ( myObject . property2 , 'data-2' , 'includes the second mixin' ) ;
198
179
}
199
180
200
181
[ '@test using instanceof' ] ( assert ) {
201
182
class MyObject extends EmberObject { }
202
183
203
- let myObject1 = MyObject . create ( ) ;
204
- let myObject2 = new MyObject ( ) ;
184
+ let myObject = MyObject . create ( ) ;
205
185
206
- assert . ok ( myObject1 instanceof MyObject ) ;
207
- assert . ok ( myObject1 instanceof EmberObject ) ;
208
-
209
- assert . ok ( myObject2 instanceof MyObject ) ;
210
- assert . ok ( myObject2 instanceof EmberObject ) ;
186
+ assert . ok ( myObject instanceof MyObject ) ;
187
+ assert . ok ( myObject instanceof EmberObject ) ;
211
188
}
212
189
213
190
[ '@test extending an ES subclass of EmberObject' ] ( assert ) {
@@ -229,10 +206,6 @@ moduleFor(
229
206
230
207
MyObject . create ( ) ;
231
208
assert . deepEqual ( calls , [ 'constructor' , 'init' ] , 'constructor then init called (create)' ) ;
232
-
233
- calls = [ ] ;
234
- new MyObject ( ) ;
235
- assert . deepEqual ( calls , [ 'constructor' , 'init' ] , 'constructor then init called (new)' ) ;
236
209
}
237
210
238
211
[ '@test calling extend on an ES subclass of EmberObject' ] ( assert ) {
@@ -261,14 +234,6 @@ moduleFor(
261
234
'constructor then init called (create)'
262
235
) ;
263
236
264
- calls = [ ] ;
265
- new MyObject ( ) ;
266
- assert . deepEqual (
267
- calls ,
268
- [ 'before constructor' , 'init' , 'after constructor' ] ,
269
- 'constructor then init called (new)'
270
- ) ;
271
-
272
237
let obj = MyObject . create ( {
273
238
foo : 456 ,
274
239
bar : 789 ,
0 commit comments