@@ -6,15 +6,6 @@ import { format } from 'prettier';
6
6
7
7
const rootPath = join ( __dirname , '..' , '..' , '..' , '..' ) ;
8
8
const fixtureRoot = join ( rootPath , 'fixtures/parcel-transformer-test-app' ) ;
9
- const extractionFixtureRoot = join ( rootPath , 'fixtures/parcel-transformer-test-extract-app' ) ;
10
- const compressingClassNameFixtureRoot = join (
11
- rootPath ,
12
- 'fixtures/parcel-transformer-test-compress-class-name-app'
13
- ) ;
14
- const customResolverFixtureRoot = join (
15
- rootPath ,
16
- 'fixtures/parcel-transformer-test-custom-resolver-app'
17
- ) ;
18
9
const babelComponentFixture = join ( rootPath , 'fixtures/babel-component' ) ;
19
10
20
11
const workerFarm = createWorkerFarm ( ) ;
@@ -79,7 +70,28 @@ it('transforms assets with babel plugin', async () => {
79
70
` ) ;
80
71
} , 50000 ) ;
81
72
73
+ it ( 'transforms assets with custom resolve and statically evaluates imports' , async ( ) => {
74
+ const customResolveFixtureRoot = join (
75
+ rootPath ,
76
+ 'fixtures/parcel-transformer-test-custom-resolve-app'
77
+ ) ;
78
+ const parcel = getParcelInstance ( customResolveFixtureRoot ) ;
79
+ const { changedAssets } = await parcel . run ( ) ;
80
+
81
+ const asset = Array . from ( changedAssets . values ( ) ) . find (
82
+ ( asset ) => asset . filePath === join ( customResolveFixtureRoot , 'src/index.jsx' )
83
+ ) ;
84
+
85
+ const code = await asset ?. getCode ( ) ;
86
+
87
+ expect ( code ) . toInclude ( 'color:red' ) ;
88
+ } , 50000 ) ;
89
+
82
90
it ( 'transforms assets with custom resolver and statically evaluates imports' , async ( ) => {
91
+ const customResolverFixtureRoot = join (
92
+ rootPath ,
93
+ 'fixtures/parcel-transformer-test-custom-resolver-app'
94
+ ) ;
83
95
const parcel = getParcelInstance ( customResolverFixtureRoot ) ;
84
96
const { changedAssets } = await parcel . run ( ) ;
85
97
@@ -93,6 +105,7 @@ it('transforms assets with custom resolver and statically evaluates imports', as
93
105
} , 50000 ) ;
94
106
95
107
it ( 'transforms assets with compiled and extraction babel plugins' , async ( ) => {
108
+ const extractionFixtureRoot = join ( rootPath , 'fixtures/parcel-transformer-test-extract-app' ) ;
96
109
const parcel = getParcelInstance ( extractionFixtureRoot ) ;
97
110
const { changedAssets, bundleGraph } = await parcel . run ( ) ;
98
111
const assets = Array . from ( changedAssets . values ( ) ) ;
@@ -216,6 +229,10 @@ it('transforms assets with compiled and extraction babel plugins', async () => {
216
229
} , 50000 ) ;
217
230
218
231
it ( 'transforms assets with class name compression enabled' , async ( ) => {
232
+ const compressingClassNameFixtureRoot = join (
233
+ rootPath ,
234
+ 'fixtures/parcel-transformer-test-compress-class-name-app'
235
+ ) ;
219
236
const parcel = getParcelInstance ( compressingClassNameFixtureRoot ) ;
220
237
const { changedAssets, bundleGraph } = await parcel . run ( ) ;
221
238
0 commit comments