Skip to content
This repository was archived by the owner on Sep 9, 2021. It is now read-only.

Commit eead4cc

Browse files
committedFeb 22, 2017
Test inline in config
1 parent 983c6f1 commit eead4cc

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed
 

‎test/fixtures/inline-options/entry.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const w1 = require('./w1.js');
2+
const w2 = require('./w2.js');

‎test/fixtures/inline-options/w1.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// w1 inlined via options

‎test/fixtures/inline-options/w2.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// w2 inlined via options

‎test/index.js

+24
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,28 @@ describe('worker-loader', () => {
9292
assert.notEqual(readFile(bundleFile).indexOf('// inlined worker test mark'), -1);
9393
})
9494
);
95+
96+
it('should inline worker with inline in options', () =>
97+
makeBundle('inline-options', {
98+
module: {
99+
rules: [
100+
{
101+
test: /(w1|w2)\.js$/,
102+
loader: '../index.js',
103+
options: {
104+
inline: true,
105+
},
106+
},
107+
],
108+
},
109+
}).then((stats) => {
110+
const bundleFile = stats.toJson('minimal').chunks
111+
.map(item => item.files)
112+
.reduce((acc, item) => acc.concat(item), [])
113+
.map(item => `expected/inline-options/${item}`)[0];
114+
assert(bundleFile);
115+
assert.notEqual(readFile(bundleFile).indexOf('// w1 inlined via options'), -1);
116+
assert.notEqual(readFile(bundleFile).indexOf('// w2 inlined via options'), -1);
117+
})
118+
);
95119
});

0 commit comments

Comments
 (0)
This repository has been archived.