Skip to content

Commit 5a216da

Browse files
committed
test: remove unnecessary test case for inline web worker
1 parent b417577 commit 5a216da

File tree

7 files changed

+5
-126
lines changed

7 files changed

+5
-126
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ module.exports = {
129129
};
130130
```
131131

132+
## Known limitations
133+
1. This plugin does not transform Web Worker syntax like `new Worker(new URL('./worker.js', import.meta.url));``. It simply embeds the source code processed by webpack into HTML files, and emits any JavaScript files that is not processed by the plugin.
134+
2. This plugin is designed to embed script content into HTML files for deployment to environments where only a single file can be uploaded, or where the script file itself is small enough that it doesn't warrant an additional HTTP request. It is not intended for use in development, and may fail if HMR is enabled.
135+
132136
## Contributors
133137

134138
Thanks goes to these wonderful people:
@@ -145,7 +149,7 @@ Thanks goes to these wonderful people:
145149
</td>
146150
<td align="center" valign="top" width="20%">
147151
<a href="https://github.com/SorsOps">
148-
<img src="https://avatars.githubusercontent.com/u/80043879?s=120&v=4" width="60px;" alt="@kmalakoff"/>
152+
<img src="https://avatars.githubusercontent.com/u/80043879?s=120&v=4" width="60px;" alt="@SorsOps"/>
149153
<br />
150154
<b>@SorsOps</b>
151155
</a>

__tests__/HtmlInlineScriptPlugin.test.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import preserveConfig from './cases/preserveAsset/webpack.config';
99
import multipleInstanceConfig from './cases/multiple-instance/webpack.config';
1010
import jsWithImportConfig from './cases/js-with-import/webpack.config';
1111
import webWorkerConfig from './cases/web-worker/webpack.config';
12-
import inlineWebWorkerConfig from './cases/inline-web-worker/webpack.config';
1312
import ignoreScriptsConfig from './cases/ignore-scripts/webpack.config';
1413
import ignoreHtmlsConfig from './cases/ignore-htmls/webpack.config';
1514
import ignoreScriptsAndHtmlsConfig from './cases/ignore-scripts-and-htmls/webpack.config';
@@ -206,39 +205,6 @@ describe('HtmlInlineScriptPlugin', () => {
206205
await webpackPromise;
207206
});
208207

209-
it('should build webpack config having inline web worker without error', async () => {
210-
const webpackPromise = new Promise((resolve) => {
211-
const compiler = webpack(inlineWebWorkerConfig);
212-
213-
compiler.run((error, stats) => {
214-
expect(error).toBeNull();
215-
216-
const statsErrors = stats?.compilation.errors;
217-
expect(statsErrors?.length).toBe(0);
218-
219-
const result1 = fs.readFileSync(
220-
path.join(__dirname, 'cases/inline-web-worker/dist/index.html'),
221-
'utf8',
222-
);
223-
224-
const expected1 = fs.readFileSync(
225-
path.join(__dirname, 'cases/inline-web-worker/expected/index.html'),
226-
'utf8',
227-
);
228-
229-
expect(result1).toBe(expected1);
230-
231-
const expectedFileList = fs.readdirSync(path.join(__dirname, 'cases/inline-web-worker/expected/'));
232-
const generatedFileList = fs.readdirSync(path.join(__dirname, 'cases/inline-web-worker/dist/'));
233-
expect(expectedFileList.sort()).toEqual(generatedFileList.sort());
234-
235-
resolve(true);
236-
});
237-
});
238-
239-
await webpackPromise;
240-
});
241-
242208
it('should inline filename with spacial characters without error', async () => {
243209
const webpackPromise = new Promise((resolve) => {
244210
const compiler = webpack(filenameWithSpecialCharactersConfig);

__tests__/cases/inline-web-worker/expected/index.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

__tests__/cases/inline-web-worker/fixtures/index.html

Lines changed: 0 additions & 15 deletions
This file was deleted.

__tests__/cases/inline-web-worker/fixtures/index.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

__tests__/cases/inline-web-worker/fixtures/worker.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

__tests__/cases/inline-web-worker/webpack.config.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)