11'use strict' ;
22
33const expect = require ( 'chai' ) . expect ;
4+ const path = require ( 'path' ) ;
45const normaliseFileName = require ( './../lib/utils/filename-normaliser' ) . normaliseFileName ;
56
67describe ( 'file name normaliser' , function ( ) {
78 describe ( 'handles module unification layout' , function ( ) {
89 it ( 'components are normalised correctly' , function ( ) {
9- const fileName = 'src/ui/components/my-component/template.hbs' ;
10+ const fileName = path . normalize ( 'src/ui/components/my-component/template.hbs' ) ;
1011 const normalisedFileName = normaliseFileName ( fileName ) ;
1112
1213 expect ( normalisedFileName ) . to . equal ( fileName ) ;
@@ -15,33 +16,33 @@ describe('file name normaliser', function() {
1516
1617 describe ( 'handles pod layout' , function ( ) {
1718 it ( 'components are normalised correctly' , function ( ) {
18- const fileName = 'broccoli-middleware/components/awesome-component/template.hbs' ;
19- const expectedFileName = 'app/components/awesome-component/template.hbs' ;
19+ const fileName = path . normalize ( 'broccoli-middleware/components/awesome-component/template.hbs' ) ;
20+ const expectedFileName = path . normalize ( 'app/components/awesome-component/template.hbs' ) ;
2021 const normalisedFileName = normaliseFileName ( fileName ) ;
2122
2223 expect ( normalisedFileName ) . to . equal ( expectedFileName ) ;
2324 } ) ;
2425
2526 it ( 'templates are normalised correctly' , function ( ) {
26- const fileName = 'broccoli-middleware/awesome-route/template.hbs' ;
27- const expectedFileName = 'app/awesome-route/template.hbs' ;
27+ const fileName = path . normalize ( 'broccoli-middleware/awesome-route/template.hbs' ) ;
28+ const expectedFileName = path . normalize ( 'app/awesome-route/template.hbs' ) ;
2829 const normalisedFileName = normaliseFileName ( fileName ) ;
2930
3031 expect ( normalisedFileName ) . to . equal ( expectedFileName ) ;
3132 } ) ;
3233
3334 describe ( 'in-repo engines are normalised correctly' , function ( ) {
3435 it ( 'components are normalised correctly' , function ( ) {
35- const fileName = 'awesome-engine/components/awesome-component/template.hbs' ;
36- const expectedFileName = 'lib/awesome-engine/addon/components/awesome-component/template.hbs' ;
36+ const fileName = path . normalize ( 'awesome-engine/components/awesome-component/template.hbs' ) ;
37+ const expectedFileName = path . normalize ( 'lib/awesome-engine/addon/components/awesome-component/template.hbs' ) ;
3738 const normalisedFileName = normaliseFileName ( fileName ) ;
3839
3940 expect ( normalisedFileName ) . to . equal ( expectedFileName ) ;
4041 } ) ;
4142
4243 it ( 'templates are normalised correctly' , function ( ) {
43- const fileName = 'awesome-engine/awesome-route/template.hbs' ;
44- const expectedFileName = 'lib/awesome-engine/addon/awesome-route/template.hbs' ;
44+ const fileName = path . normalize ( 'awesome-engine/awesome-route/template.hbs' ) ;
45+ const expectedFileName = path . normalize ( 'lib/awesome-engine/addon/awesome-route/template.hbs' ) ;
4546 const normalisedFileName = normaliseFileName ( fileName ) ;
4647
4748 expect ( normalisedFileName ) . to . equal ( expectedFileName ) ;
@@ -51,33 +52,33 @@ describe('file name normaliser', function() {
5152
5253 describe ( 'handles classic layout' , function ( ) {
5354 it ( 'components are normalised correctly' , function ( ) {
54- const fileName = 'broccoli-middleware/templates/components/awesome-component.hbs' ;
55- const expectedFileName = 'app/templates/components/awesome-component.hbs' ;
55+ const fileName = path . normalize ( 'broccoli-middleware/templates/components/awesome-component.hbs' ) ;
56+ const expectedFileName = path . normalize ( 'app/templates/components/awesome-component.hbs' ) ;
5657 const normalisedFileName = normaliseFileName ( fileName ) ;
5758
5859 expect ( normalisedFileName ) . to . equal ( expectedFileName ) ;
5960 } ) ;
6061
6162 it ( 'templates are normalised correctly' , function ( ) {
62- const fileName = 'broccoli-middleware/templates/application.hbs' ;
63- const expectedFileName = 'app/templates/application.hbs' ;
63+ const fileName = path . normalize ( 'broccoli-middleware/templates/application.hbs' ) ;
64+ const expectedFileName = path . normalize ( 'app/templates/application.hbs' ) ;
6465 const normalisedFileName = normaliseFileName ( fileName ) ;
6566
6667 expect ( normalisedFileName ) . to . equal ( expectedFileName ) ;
6768 } ) ;
6869
6970 describe ( 'in-repo engines are normalised correctly' , function ( ) {
7071 it ( 'components are normalised correctly' , function ( ) {
71- const fileName = 'awesome-engine/templates/components/awesome-component.hbs' ;
72- const expectedFileName = 'lib/awesome-engine/addon/templates/components/awesome-component.hbs' ;
72+ const fileName = path . normalize ( 'awesome-engine/templates/components/awesome-component.hbs' ) ;
73+ const expectedFileName = path . normalize ( 'lib/awesome-engine/addon/templates/components/awesome-component.hbs' ) ;
7374 const normalisedFileName = normaliseFileName ( fileName ) ;
7475
7576 expect ( normalisedFileName ) . to . equal ( expectedFileName ) ;
7677 } ) ;
7778
7879 it ( 'templates are normalised correctly' , function ( ) {
79- const fileName = 'awesome-engine/templates/awesome-route.hbs' ;
80- const expectedFileName = 'lib/awesome-engine/addon/templates/awesome-route.hbs' ;
80+ const fileName = path . normalize ( 'awesome-engine/templates/awesome-route.hbs' ) ;
81+ const expectedFileName = path . normalize ( 'lib/awesome-engine/addon/templates/awesome-route.hbs' ) ;
8182 const normalisedFileName = normaliseFileName ( fileName ) ;
8283
8384 expect ( normalisedFileName ) . to . equal ( expectedFileName ) ;
0 commit comments