@@ -20,7 +20,6 @@ test('identifyCssModule(filePath)', async () => {
20
20
const result = await identifyCssModule ( filePath ) ;
21
21
22
22
const identifier = {
23
- id : hasher ( `my-module-1|1.0.1|${ fileRef } ` ) ,
24
23
name : 'my-module-1' ,
25
24
version : '1.0.1' ,
26
25
file : fileRef ,
@@ -36,7 +35,6 @@ test('identifyCssModule(filePath) css in nested directory', async () => {
36
35
const result = await identifyCssModule ( filePath ) ;
37
36
38
37
const identifier = {
39
- id : hasher ( `my-module-2|1.0.1|${ fileRef } ` ) ,
40
38
name : 'my-module-2' ,
41
39
version : '1.0.1' ,
42
40
file : fileRef ,
@@ -70,7 +68,7 @@ test('new Writer(filePath)', done => {
70
68
writer . on ( 'end' , ( ) => {
71
69
const result1 = items [ 0 ] ;
72
70
const result2 = items [ 1 ] ;
73
- expect ( result1 . id ) . toBe ( hasher ( `my-module-1|1.0.1|${ fileRef } ` ) ) ;
71
+ expect ( result1 . id ) . toBe ( hasher ( `my-module-1|1.0.1|${ fileRef } | ${ result1 . content } ` ) ) ;
74
72
expect ( result2 ) . toBeFalsy ( ) ;
75
73
done ( ) ;
76
74
} ) ;
@@ -100,7 +98,7 @@ test('new Writer([filePath])', done => {
100
98
writer . on ( 'end' , ( ) => {
101
99
const result1 = items [ 0 ] ;
102
100
const result2 = items [ 1 ] ;
103
- expect ( result1 . id ) . toBe ( hasher ( `my-module-1|1.0.1|${ fileRef } ` ) ) ;
101
+ expect ( result1 . id ) . toBe ( hasher ( `my-module-1|1.0.1|${ fileRef } | ${ result1 . content } ` ) ) ;
104
102
expect ( result2 ) . toBeFalsy ( ) ;
105
103
done ( ) ;
106
104
} ) ;
@@ -122,7 +120,7 @@ test('Writer processes @import statements', done => {
122
120
const result1 = items [ 0 ] ;
123
121
const result2 = items [ 1 ] ;
124
122
125
- expect ( result1 . id ) . toBe ( hasher ( `my-module-3|1.0.1|${ fileRef } ` ) ) ;
123
+ expect ( result1 . id ) . toBe ( hasher ( `my-module-3|1.0.1|${ fileRef } | ${ result1 . content } ` ) ) ;
126
124
expect ( result1 . content ) . toMatch ( 'my-module-3/main.css' ) ;
127
125
expect ( result1 . content ) . toMatch ( 'my-module-3/dep.css' ) ;
128
126
expect ( result1 . content ) . toMatch ( 'dep/main.css' ) ;
@@ -150,8 +148,8 @@ test('new Writer([filePath1, filePath2]) ensures correct order', done => {
150
148
const result2 = items [ 1 ] ;
151
149
const result3 = items [ 2 ] ;
152
150
153
- expect ( result1 . id ) . toBe ( hasher ( `my-module-1|1.0.1|${ fileRef1 } ` ) ) ;
154
- expect ( result2 . id ) . toBe ( hasher ( `my-module-2|1.0.1|${ fileRef2 } ` ) ) ;
151
+ expect ( result1 . id ) . toBe ( hasher ( `my-module-1|1.0.1|${ fileRef1 } | ${ result1 . content } ` ) ) ;
152
+ expect ( result2 . id ) . toBe ( hasher ( `my-module-2|1.0.1|${ fileRef2 } | ${ result2 . content } ` ) ) ;
155
153
expect ( result3 ) . toBeFalsy ( ) ;
156
154
done ( ) ;
157
155
} ) ;
0 commit comments