@@ -61,7 +61,6 @@ test('bundleCssModule(filePath)', async () => {
61
61
test ( 'new Writer(filePath)' , done => {
62
62
expect . assertions ( 2 ) ;
63
63
const filePath = path . join ( __dirname , 'test-assets/my-module-1/main.css' ) ;
64
- const fileRef = 'my-module-1/main.css' ;
65
64
66
65
const writer = new Writer ( filePath ) . bundle ( ) ;
67
66
const items = [ ] ;
@@ -73,9 +72,7 @@ test('new Writer(filePath)', done => {
73
72
writer . on ( 'end' , ( ) => {
74
73
const result1 = items [ 0 ] ;
75
74
const result2 = items [ 1 ] ;
76
- expect ( result1 . id ) . toBe (
77
- hasher ( `my-module-1|1.0.1|${ fileRef } |${ result1 . content } ` )
78
- ) ;
75
+ expect ( result1 . id ) . toBe ( hasher ( result1 . content ) ) ;
79
76
expect ( result2 ) . toBeFalsy ( ) ;
80
77
done ( ) ;
81
78
} ) ;
@@ -118,7 +115,6 @@ test('new Writer(filePath) relative paths throw error', () => {
118
115
test ( 'new Writer([filePath])' , done => {
119
116
expect . assertions ( 2 ) ;
120
117
const filePath = path . join ( __dirname , 'test-assets/my-module-1/main.css' ) ;
121
- const fileRef = 'my-module-1/main.css' ;
122
118
123
119
const writer = new Writer ( [ filePath ] ) . bundle ( ) ;
124
120
const items = [ ] ;
@@ -130,9 +126,7 @@ test('new Writer([filePath])', done => {
130
126
writer . on ( 'end' , ( ) => {
131
127
const result1 = items [ 0 ] ;
132
128
const result2 = items [ 1 ] ;
133
- expect ( result1 . id ) . toBe (
134
- hasher ( `my-module-1|1.0.1|${ fileRef } |${ result1 . content } ` )
135
- ) ;
129
+ expect ( result1 . id ) . toBe ( hasher ( result1 . content ) ) ;
136
130
expect ( result2 ) . toBeFalsy ( ) ;
137
131
done ( ) ;
138
132
} ) ;
@@ -144,7 +138,6 @@ test('Writer processes @import statements', done => {
144
138
__dirname ,
145
139
'test-assets/my-module-3/css/main.css'
146
140
) ;
147
- const fileRef = 'my-module-3/css/main.css' ;
148
141
149
142
const writer = new Writer ( [ filePath ] ) . bundle ( ) ;
150
143
const items = [ ] ;
@@ -157,9 +150,7 @@ test('Writer processes @import statements', done => {
157
150
const result1 = items [ 0 ] ;
158
151
const result2 = items [ 1 ] ;
159
152
160
- expect ( result1 . id ) . toBe (
161
- hasher ( `my-module-3|1.0.1|${ fileRef } |${ result1 . content } ` )
162
- ) ;
153
+ expect ( result1 . id ) . toBe ( hasher ( result1 . content ) ) ;
163
154
expect ( result1 . content ) . toMatch ( 'my-module-3/main.css' ) ;
164
155
expect ( result1 . content ) . toMatch ( 'my-module-3/dep.css' ) ;
165
156
expect ( result1 . content ) . toMatch ( 'dep/main.css' ) ;
@@ -171,12 +162,10 @@ test('Writer processes @import statements', done => {
171
162
test ( 'new Writer([filePath1, filePath2]) ensures correct order' , done => {
172
163
expect . assertions ( 3 ) ;
173
164
const filePath1 = path . join ( __dirname , 'test-assets/my-module-1/main.css' ) ;
174
- const fileRef1 = 'my-module-1/main.css' ;
175
165
const filePath2 = path . join (
176
166
__dirname ,
177
167
'test-assets/my-module-2/css/main.css'
178
168
) ;
179
- const fileRef2 = 'my-module-2/css/main.css' ;
180
169
181
170
const writer = new Writer ( [ filePath1 , filePath2 ] ) . bundle ( ) ;
182
171
const items = [ ] ;
@@ -190,12 +179,8 @@ test('new Writer([filePath1, filePath2]) ensures correct order', done => {
190
179
const result2 = items [ 1 ] ;
191
180
const result3 = items [ 2 ] ;
192
181
193
- expect ( result1 . id ) . toBe (
194
- hasher ( `my-module-1|1.0.1|${ fileRef1 } |${ result1 . content } ` )
195
- ) ;
196
- expect ( result2 . id ) . toBe (
197
- hasher ( `my-module-2|1.0.1|${ fileRef2 } |${ result2 . content } ` )
198
- ) ;
182
+ expect ( result1 . id ) . toBe ( hasher ( result1 . content ) ) ;
183
+ expect ( result2 . id ) . toBe ( hasher ( result2 . content ) ) ;
199
184
expect ( result3 ) . toBeFalsy ( ) ;
200
185
done ( ) ;
201
186
} ) ;
0 commit comments