@@ -38,12 +38,12 @@ describe('isDSModel', () => {
3838 } ) ;
3939
4040 describe ( "should check if it's a DS Model even if it uses custom name" , ( ) => {
41- it ( "it shouldn't detect Model when no file path is provided" , ( ) => {
41+ it ( "shouldn't detect Model when no file path is provided" , ( ) => {
4242 const node = parse ( 'CustomModel.extend()' ) ;
4343 expect ( emberUtils . isDSModel ( node ) ) . toBeFalsy ( ) ;
4444 } ) ;
4545
46- it ( 'it should detect Model when file path is provided' , ( ) => {
46+ it ( 'should detect Model when file path is provided' , ( ) => {
4747 const node = parse ( 'CustomModel.extend()' ) ;
4848 const filePath = 'example-app/models/path/to/some-model.js' ;
4949 expect ( emberUtils . isDSModel ( node , filePath ) ) . toBeTruthy ( ) ;
@@ -98,7 +98,7 @@ describe('isTestFile', () => {
9898} ) ;
9999
100100describe ( 'isEmberCoreModule' , ( ) => {
101- it ( 'should check if current file is a component' , ( ) => {
101+ it ( 'should check if current file is a component (custom) ' , ( ) => {
102102 const context = new FauxContext (
103103 'CustomComponent.extend()' ,
104104 'example-app/components/path/to/some-component.js'
@@ -116,7 +116,7 @@ describe('isEmberCoreModule', () => {
116116 expect ( emberUtils . isEmberCoreModule ( context , node , 'Component' ) ) . toBeTruthy ( ) ;
117117 } ) ;
118118
119- it ( 'should check if current file is a controller' , ( ) => {
119+ it ( 'should check if current file is a controller (custom) ' , ( ) => {
120120 const context = new FauxContext (
121121 'CustomController.extend()' ,
122122 'example-app/controllers/path/to/some-controller.js'
@@ -134,7 +134,7 @@ describe('isEmberCoreModule', () => {
134134 expect ( emberUtils . isEmberCoreModule ( context , node , 'Controller' ) ) . toBeTruthy ( ) ;
135135 } ) ;
136136
137- it ( 'should check if current file is a route' , ( ) => {
137+ it ( 'should check if current file is a route (custom) ' , ( ) => {
138138 const context = new FauxContext (
139139 'CustomRoute.extend()' ,
140140 'example-app/routes/path/to/some-route.js'
@@ -163,13 +163,13 @@ describe('isEmberCoreModule', () => {
163163
164164describe ( 'isEmberComponent' , ( ) => {
165165 describe ( "should check if it's an Ember Component" , ( ) => {
166- it ( 'it should detect Component when using Ember.Component' , ( ) => {
166+ it ( 'should detect Component when using Ember.Component' , ( ) => {
167167 const context = new FauxContext ( 'Ember.Component.extend()' ) ;
168168 const node = context . ast . body [ 0 ] . expression ;
169169 expect ( emberUtils . isEmberComponent ( context , node ) ) . toBeTruthy ( ) ;
170170 } ) ;
171171
172- it ( 'it should detect Component when using local module Component' , ( ) => {
172+ it ( 'should detect Component when using local module Component' , ( ) => {
173173 const context = new FauxContext ( 'Component.extend()' ) ;
174174 const node = context . ast . body [ 0 ] . expression ;
175175 expect ( emberUtils . isEmberComponent ( context , node ) ) . toBeTruthy ( ) ;
@@ -195,13 +195,13 @@ describe('isEmberComponent', () => {
195195 } ) ;
196196
197197 describe ( "should check if it's an Ember Component even if it uses custom name" , ( ) => {
198- it ( "it shouldn't detect Component when no file path is provided" , ( ) => {
198+ it ( "shouldn't detect Component when no file path is provided" , ( ) => {
199199 const context = new FauxContext ( 'CustomComponent.extend()' ) ;
200200 const node = context . ast . body [ 0 ] . expression ;
201201 expect ( emberUtils . isEmberComponent ( context , node ) ) . toBeFalsy ( ) ;
202202 } ) ;
203203
204- it ( 'it should detect Component when file path is provided' , ( ) => {
204+ it ( 'should detect Component when file path is provided' , ( ) => {
205205 const context = new FauxContext (
206206 'CustomComponent.extend()' ,
207207 'example-app/components/path/to/some-component.js'
@@ -223,13 +223,13 @@ describe('isEmberComponent', () => {
223223
224224describe ( 'isEmberController' , ( ) => {
225225 describe ( "should check if it's an Ember Controller" , ( ) => {
226- it ( 'it should detect Controller when using Ember.Controller' , ( ) => {
226+ it ( 'should detect Controller when using Ember.Controller' , ( ) => {
227227 const context = new FauxContext ( 'Ember.Controller.extend()' ) ;
228228 const node = context . ast . body [ 0 ] . expression ;
229229 expect ( emberUtils . isEmberController ( context , node ) ) . toBeTruthy ( ) ;
230230 } ) ;
231231
232- it ( 'it should detect Controller when using local module Controller' , ( ) => {
232+ it ( 'should detect Controller when using local module Controller' , ( ) => {
233233 const context = new FauxContext ( 'Controller.extend()' ) ;
234234 const node = context . ast . body [ 0 ] . expression ;
235235 expect ( emberUtils . isEmberController ( context , node ) ) . toBeTruthy ( ) ;
@@ -255,13 +255,13 @@ describe('isEmberController', () => {
255255 } ) ;
256256
257257 describe ( "should check if it's an Ember Controller even if it uses custom name" , ( ) => {
258- it ( "it shouldn't detect Controller when no file path is provided" , ( ) => {
258+ it ( "shouldn't detect Controller when no file path is provided" , ( ) => {
259259 const context = new FauxContext ( 'CustomController.extend()' ) ;
260260 const node = context . ast . body [ 0 ] . expression ;
261261 expect ( emberUtils . isEmberController ( context , node ) ) . toBeFalsy ( ) ;
262262 } ) ;
263263
264- it ( 'it should detect Controller when file path is provided' , ( ) => {
264+ it ( 'should detect Controller when file path is provided' , ( ) => {
265265 const context = new FauxContext (
266266 'CustomController.extend()' ,
267267 'example-app/controllers/path/to/some-feature.js'
@@ -315,13 +315,13 @@ describe('isEmberRoute', () => {
315315 } ) ;
316316
317317 describe ( "should check if it's an Ember Route even if it uses custom name" , ( ) => {
318- it ( "it shouldn't detect Route when no file path is provided" , ( ) => {
318+ it ( "shouldn't detect Route when no file path is provided" , ( ) => {
319319 const context = new FauxContext ( 'CustomRoute.extend()' ) ;
320320 const node = context . ast . body [ 0 ] . expression ;
321321 expect ( emberUtils . isEmberRoute ( context , node ) ) . toBeFalsy ( ) ;
322322 } ) ;
323323
324- it ( 'it should detect Route when file path is provided' , ( ) => {
324+ it ( 'should detect Route when file path is provided' , ( ) => {
325325 const context = new FauxContext (
326326 'CustomRoute.extend()' ,
327327 'example-app/routes/path/to/some-feature.js'
@@ -415,7 +415,7 @@ describe('isEmberService', () => {
415415 expect ( emberUtils . isEmberService ( context , node ) ) . toBeFalsy ( ) ;
416416 } ) ;
417417
418- it ( 'it should detect Service when file path is provided' , ( ) => {
418+ it ( 'should detect Service when file path is provided' , ( ) => {
419419 const context = new FauxContext (
420420 'CustomService.extend()' ,
421421 'example-app/services/path/to/some-feature.js'
@@ -1031,38 +1031,50 @@ describe('isRelation', () => {
10311031describe ( 'parseDependentKeys' , ( ) => {
10321032 it ( 'should parse dependent keys from callexpression' , ( ) => {
10331033 const node = parse ( "computed('model.{foo,bar}', 'model.bar')" ) ;
1034- expect ( emberUtils . parseDependentKeys ( node ) ) . toEqual ( [ 'model.foo' , 'model.bar' , 'model.bar' ] ) ;
1034+ expect ( emberUtils . parseDependentKeys ( node ) ) . toStrictEqual ( [
1035+ 'model.foo' ,
1036+ 'model.bar' ,
1037+ 'model.bar' ,
1038+ ] ) ;
10351039 } ) ;
10361040
10371041 it ( 'should work when no dependent keys present' , ( ) => {
10381042 const node = parse ( 'computed(function() {})' ) ;
1039- expect ( emberUtils . parseDependentKeys ( node ) ) . toEqual ( [ ] ) ;
1043+ expect ( emberUtils . parseDependentKeys ( node ) ) . toStrictEqual ( [ ] ) ;
10401044 } ) ;
10411045
10421046 it ( 'should handle dependent keys and function arguments' , ( ) => {
10431047 const node = parse ( "computed('model.{foo,bar}', 'model.bar', function() {})" ) ;
1044- expect ( emberUtils . parseDependentKeys ( node ) ) . toEqual ( [ 'model.foo' , 'model.bar' , 'model.bar' ] ) ;
1048+ expect ( emberUtils . parseDependentKeys ( node ) ) . toStrictEqual ( [
1049+ 'model.foo' ,
1050+ 'model.bar' ,
1051+ 'model.bar' ,
1052+ ] ) ;
10451053 } ) ;
10461054
10471055 it ( 'should handle dependent keys and function arguments in MemberExpression' , ( ) => {
10481056 const node = parse ( `
10491057 computed('model.{foo,bar}', 'model.bar', function() {
10501058 }).volatile();
10511059 ` ) ;
1052- expect ( emberUtils . parseDependentKeys ( node ) ) . toEqual ( [ 'model.foo' , 'model.bar' , 'model.bar' ] ) ;
1060+ expect ( emberUtils . parseDependentKeys ( node ) ) . toStrictEqual ( [
1061+ 'model.foo' ,
1062+ 'model.bar' ,
1063+ 'model.bar' ,
1064+ ] ) ;
10531065 } ) ;
10541066} ) ;
10551067
10561068describe ( 'unwrapBraceExpressions' , ( ) => {
10571069 it ( 'should unwrap simple dependent keys' , ( ) => {
1058- expect ( emberUtils . unwrapBraceExpressions ( [ 'model.foo' , 'model.bar' ] ) ) . toEqual ( [
1070+ expect ( emberUtils . unwrapBraceExpressions ( [ 'model.foo' , 'model.bar' ] ) ) . toStrictEqual ( [
10591071 'model.foo' ,
10601072 'model.bar' ,
10611073 ] ) ;
10621074 } ) ;
10631075
10641076 it ( 'should unwrap dependent keys with braces' , ( ) => {
1065- expect ( emberUtils . unwrapBraceExpressions ( [ 'model.{foo,bar}' , 'model.bar' ] ) ) . toEqual ( [
1077+ expect ( emberUtils . unwrapBraceExpressions ( [ 'model.{foo,bar}' , 'model.bar' ] ) ) . toStrictEqual ( [
10661078 'model.foo' ,
10671079 'model.bar' ,
10681080 'model.bar' ,
@@ -1072,33 +1084,31 @@ describe('unwrapBraceExpressions', () => {
10721084 it ( 'should unwrap more complex dependent keys' , ( ) => {
10731085 expect (
10741086 emberUtils . unwrapBraceExpressions ( [ 'model.{foo,bar}' , 'model.bar' , 'data.{foo,baz,qux}' ] )
1075- ) . toEqual ( [ 'model.foo' , 'model.bar' , 'model.bar' , 'data.foo' , 'data.baz' , 'data.qux' ] ) ;
1087+ ) . toStrictEqual ( [ 'model.foo' , 'model.bar' , 'model.bar' , 'data.foo' , 'data.baz' , 'data.qux' ] ) ;
10761088 } ) ;
10771089
10781090 it ( 'should unwrap multi-level keys' , ( ) => {
1079- expect ( emberUtils . unwrapBraceExpressions ( [ 'model.bar.{foo,qux}' , 'model.bar.baz' ] ) ) . toEqual ( [
1080- 'model.bar.foo' ,
1081- 'model.bar.qux' ,
1082- 'model.bar.baz' ,
1083- ] ) ;
1091+ expect (
1092+ emberUtils . unwrapBraceExpressions ( [ 'model.bar.{foo,qux}' , 'model.bar.baz' ] )
1093+ ) . toStrictEqual ( [ 'model.bar.foo' , 'model.bar.qux' , 'model.bar.baz' ] ) ;
10841094 } ) ;
10851095
10861096 it ( 'should unwrap @each with extensions' , ( ) => {
10871097 expect (
10881098 emberUtils . unwrapBraceExpressions ( [ 'collection.@each.{foo,bar}' , '[email protected] ' ] ) 1089- 1099+ 10901100 } ) ;
10911101
10921102 it ( 'should unwrap complicated mixed dependent keys' , ( ) => {
1093- expect ( emberUtils . unwrapBraceExpressions ( [ 'a.b.c.{[email protected] ,f,g.[]}' ] ) ) . toEqual ( [ 1103+ expect ( emberUtils . unwrapBraceExpressions ( [ 'a.b.c.{[email protected] ,f,g.[]}' ] ) ) . toStrictEqual ( [ 1094110410951105 'a.b.c.f' ,
10961106 'a.b.c.g.[]' ,
10971107 ] ) ;
10981108 } ) ;
10991109
11001110 it ( 'should unwrap complicated mixed repeated dependent keys' , ( ) => {
1101- expect ( emberUtils . unwrapBraceExpressions ( [ 'a.b.{[email protected] ,f,[email protected] }' ] ) ) . toEqual ( [ 1111+ expect ( emberUtils . unwrapBraceExpressions ( [ 'a.b.{[email protected] ,f,[email protected] }' ] ) ) . toStrictEqual ( [ 1102111211031113 'a.b.f' ,
11041114@@ -1139,7 +1149,7 @@ describe('hasDuplicateDependentKeys', () => {
11391149describe ( 'getEmberImportAliasName' , ( ) => {
11401150 it ( 'should get the proper name of default import' , ( ) => {
11411151 const node = babelEslint . parse ( "import foo from 'ember'" ) . body [ 0 ] ;
1142- expect ( emberUtils . getEmberImportAliasName ( node ) ) . toEqual ( 'foo' ) ;
1152+ expect ( emberUtils . getEmberImportAliasName ( node ) ) . toStrictEqual ( 'foo' ) ;
11431153 } ) ;
11441154} ) ;
11451155
0 commit comments