Skip to content
This repository was archived by the owner on Jun 24, 2024. It is now read-only.

Commit 04bd73e

Browse files
committed
test: remove unused clean utility
1 parent 9113289 commit 04bd73e

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

test/reader.test.js

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ function getExecutionOrder(bundle) {
2121
return JSON.parse(order);
2222
}
2323

24-
function clean(content) {
25-
return content.replace(/"\/.*\/asset-pipe-js-reader\//g, '"/');
26-
}
27-
2824
beforeEach(() => {
2925
jest.setTimeout(10000);
3026
return remove(FOLDER);
@@ -42,7 +38,7 @@ test('source maps as an option', async () => {
4238
sourceMaps: true,
4339
});
4440

45-
expect(clean(prettier.format(content))).toMatchSnapshot();
41+
expect(prettier.format(content)).toMatchSnapshot();
4642
});
4743

4844
test('minification with uglify as an option', async () => {
@@ -56,7 +52,7 @@ test('minification with uglify as an option', async () => {
5652
minify: true,
5753
});
5854

59-
expect(clean(prettier.format(content))).toMatchSnapshot();
55+
expect(prettier.format(content)).toMatchSnapshot();
6056
});
6157

6258
test('minification with uglify and sourceMaps as options', async () => {
@@ -71,7 +67,7 @@ test('minification with uglify and sourceMaps as options', async () => {
7167
sourceMaps: true,
7268
});
7369

74-
expect(clean(prettier.format(content))).toMatchSnapshot();
70+
expect(prettier.format(content)).toMatchSnapshot();
7571
});
7672

7773
test('should successfully bundle 2 feeds', async () => {
@@ -84,7 +80,7 @@ test('should successfully bundle 2 feeds', async () => {
8480
directory: FOLDER,
8581
});
8682

87-
expect(clean(prettier.format(content))).toMatchSnapshot();
83+
expect(prettier.format(content)).toMatchSnapshot();
8884
});
8985

9086
test('should successfully bundle 2 feeds when temp directory is used', async () => {
@@ -95,7 +91,7 @@ test('should successfully bundle 2 feeds when temp directory is used', async ()
9591

9692
const content = await bundleJS([feedA, feedB]);
9793

98-
expect(clean(prettier.format(content))).toMatchSnapshot();
94+
expect(prettier.format(content)).toMatchSnapshot();
9995
});
10096

10197
test('should dedupe', async () => {
@@ -108,7 +104,7 @@ test('should dedupe', async () => {
108104
directory: FOLDER,
109105
});
110106

111-
expect(clean(prettier.format(content))).toMatchSnapshot();
107+
expect(prettier.format(content)).toMatchSnapshot();
112108
});
113109

114110
test('should handle node_modules dependencies', async () => {
@@ -121,7 +117,7 @@ test('should handle node_modules dependencies', async () => {
121117
const content = await bundleJS([feedA, feedB, feedC], {
122118
directory: FOLDER,
123119
});
124-
expect(clean(prettier.format(content))).toMatchSnapshot();
120+
expect(prettier.format(content)).toMatchSnapshot();
125121
});
126122

127123
test('should concat 3 files', async () => {
@@ -138,7 +134,7 @@ test('should concat 3 files', async () => {
138134

139135
expect(executionOrder).toHaveLength(3);
140136
expect(executionOrder).toEqual([10, 4, 19]);
141-
expect(clean(prettier.format(content))).toMatchSnapshot();
137+
expect(prettier.format(content)).toMatchSnapshot();
142138
});
143139

144140
test('should concat 2 files', async () => {
@@ -155,7 +151,7 @@ test('should concat 2 files', async () => {
155151

156152
expect(executionOrder).toHaveLength(2);
157153
expect(executionOrder).toEqual([3, 9]);
158-
expect(clean(prettier.format(content))).toMatchSnapshot();
154+
expect(prettier.format(content)).toMatchSnapshot();
159155
});
160156

161157
test('should concat 1 file', async () => {
@@ -171,7 +167,7 @@ test('should concat 1 file', async () => {
171167

172168
expect(executionOrder).toHaveLength(1);
173169
expect(executionOrder).toEqual([3]);
174-
expect(clean(prettier.format(content))).toMatchSnapshot();
170+
expect(prettier.format(content)).toMatchSnapshot();
175171
});
176172

177173
test('code reaches single entry point', async () => {
@@ -284,7 +280,7 @@ test('code reaches 3 entry points', async () => {
284280
const spy = jest.fn();
285281
vm.runInNewContext(result, { spy });
286282

287-
expect(clean(prettier.format(result))).toMatchSnapshot();
283+
expect(prettier.format(result)).toMatchSnapshot();
288284
expect(spy).toHaveBeenCalledTimes(3);
289285
expect(spy).toMatchSnapshot();
290286
});
@@ -330,7 +326,7 @@ test('bundling dedupes common modules', async () => {
330326
const spy = jest.fn();
331327
vm.runInNewContext(result, { spy });
332328

333-
expect(clean(prettier.format(result))).toMatchSnapshot();
329+
expect(prettier.format(result)).toMatchSnapshot();
334330
expect(spy).toMatchSnapshot();
335331
expect(spy).toHaveBeenCalledTimes(4);
336332
});
@@ -376,7 +372,7 @@ test('minified code runs as expected', async () => {
376372
);
377373
const spy = jest.fn();
378374
vm.runInNewContext(result, { spy });
379-
expect(clean(prettier.format(result))).toMatchSnapshot();
375+
expect(prettier.format(result)).toMatchSnapshot();
380376
expect(spy).toMatchSnapshot();
381377
expect(spy).toHaveBeenCalledTimes(4);
382378
});
@@ -424,7 +420,7 @@ test('multiple entrypoints in same feed supported', async () => {
424420
const spy = jest.fn();
425421
vm.runInNewContext(result, { spy });
426422

427-
expect(clean(prettier.format(result))).toMatchSnapshot();
423+
expect(prettier.format(result)).toMatchSnapshot();
428424
expect(spy).toMatchSnapshot();
429425
expect(spy).toHaveBeenCalledTimes(4);
430426
});

0 commit comments

Comments
 (0)