Skip to content

Commit cea06cd

Browse files
authored
Merge pull request #451 from icelam/test-different-os
ci: run tests on different os
2 parents 24fe767 + 5a216da commit cea06cd

File tree

8 files changed

+8
-127
lines changed

8 files changed

+8
-127
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ on:
1313
jobs:
1414
test:
1515
name: Test
16-
runs-on: ubuntu-latest
1716
strategy:
1817
matrix:
1918
node-version: [14.x, 16.x, 18.x, 20.x]
19+
os: [ubuntu-latest, windows-latest, macos-latest]
20+
runs-on: ${{ matrix.os }}
2021
env:
2122
HUSKY: 0
2223
steps:
@@ -28,6 +29,7 @@ jobs:
2829
node-version: ${{ matrix.node-version }}
2930
- name: Get yarn cache directory path
3031
id: yarn-cache-dir-path
32+
shell: bash
3133
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
3234
- name: Restore yarn cache
3335
uses: actions/cache@v3

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)