This repository has been archived by the owner on Sep 9, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f729e34
commit 800b074
Showing
64 changed files
with
3,283 additions
and
3,670 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
/dist | ||
/node_modules | ||
/test/fixtures | ||
/test/__expected__ | ||
/test/outputs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
/dist | ||
/node_modules | ||
/test/fixtures | ||
/test/__expected__ | ||
/test/outputs | ||
CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import path from 'path'; | ||
|
||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import del from 'del'; | ||
|
||
async function setup() { | ||
await del(path.resolve(__dirname, `./test/outputs`)); | ||
} | ||
|
||
module.exports = setup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
testEnvironment: 'node', | ||
globalSetup: '<rootDir>/globalSetupTest.js', | ||
setupFilesAfterEnv: ['<rootDir>/setupTest.js'], | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
jest.setTimeout(60000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,6 @@ export function pitch(request) { | |
baseDataPath: 'options', | ||
}); | ||
|
||
validateOptions({ name: 'Worker Loader', schema, target: options }); | ||
|
||
this.cacheable(false); | ||
|
||
const cb = this.async(); | ||
|
@@ -47,8 +45,6 @@ export function pitch(request) { | |
worker.options | ||
); | ||
|
||
// Tapable.apply is deprecated in [email protected]. | ||
// The plugins should now call apply themselves. | ||
new WebWorkerTemplatePlugin(worker.options).apply(worker.compiler); | ||
|
||
if (this.target !== 'webworker' && this.target !== 'web') { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`"fallback" option should should work with "false" value: errors 1`] = `Array []`; | ||
|
||
exports[`"fallback" option should should work with "false" value: result 1`] = `"{\\"postMessage\\":true,\\"onmessage\\":true}"`; | ||
|
||
exports[`"fallback" option should should work with "false" value: warnings 1`] = `Array []`; | ||
|
||
exports[`"fallback" option should should work with "true" value: errors 1`] = `Array []`; | ||
|
||
exports[`"fallback" option should should work with "true" value: result 1`] = `"{\\"postMessage\\":true,\\"onmessage\\":true}"`; | ||
|
||
exports[`"fallback" option should should work with "true" value: warnings 1`] = `Array []`; | ||
|
||
exports[`"fallback" option should work by default: errors 1`] = `Array []`; | ||
|
||
exports[`"fallback" option should work by default: result 1`] = `"{\\"postMessage\\":true,\\"onmessage\\":true}"`; | ||
|
||
exports[`"fallback" option should work by default: warnings 1`] = `Array []`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`"inline" option should not work by default: errors 1`] = `Array []`; | ||
|
||
exports[`"inline" option should not work by default: module 1`] = ` | ||
"module.exports = function() { | ||
return new Worker(__webpack_public_path__ + \\"test.worker.js\\"); | ||
};" | ||
`; | ||
|
||
exports[`"inline" option should not work by default: result 1`] = `"{\\"postMessage\\":true,\\"onmessage\\":true}"`; | ||
|
||
exports[`"inline" option should not work by default: warnings 1`] = `Array []`; | ||
|
||
exports[`"inline" option should not work with "false" value: errors 1`] = `Array []`; | ||
|
||
exports[`"inline" option should not work with "false" value: module 1`] = ` | ||
"module.exports = function() { | ||
return new Worker(__webpack_public_path__ + \\"test.worker.js\\"); | ||
};" | ||
`; | ||
|
||
exports[`"inline" option should not work with "false" value: result 1`] = `"{\\"postMessage\\":true,\\"onmessage\\":true}"`; | ||
|
||
exports[`"inline" option should not work with "false" value: warnings 1`] = `Array []`; | ||
|
||
exports[`"inline" option should work with "true" value: errors 1`] = `Array []`; | ||
|
||
exports[`"inline" option should work with "true" value: result 1`] = `"{\\"postMessage\\":true,\\"onmessage\\":true}"`; | ||
|
||
exports[`"inline" option should work with "true" value: warnings 1`] = `Array []`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`worker-loader should work worker through puppeteer: result 1`] = `"{\\"a\\":1,\\"worker\\":\\"passed\\"}"`; | ||
exports[`worker-loader should work with inline syntax: errors 1`] = `Array []`; | ||
|
||
exports[`worker-loader should work with inline syntax: module 1`] = ` | ||
"module.exports = function() { | ||
return new Worker(__webpack_public_path__ + \\"test.worker.js\\"); | ||
};" | ||
`; | ||
|
||
exports[`worker-loader should work with inline syntax: result 1`] = `"{\\"postMessage\\":true,\\"onmessage\\":true}"`; | ||
|
||
exports[`worker-loader should work with inline syntax: warnings 1`] = `Array []`; | ||
|
||
exports[`worker-loader should work: errors 1`] = `Array []`; | ||
|
||
exports[`worker-loader should work: module 1`] = ` | ||
"module.exports = function() { | ||
return new Worker(__webpack_public_path__ + \\"test.worker.js\\"); | ||
};" | ||
`; | ||
|
||
exports[`worker-loader should work: result 1`] = `"{\\"postMessage\\":true,\\"onmessage\\":true}"`; | ||
|
||
exports[`worker-loader should work: warnings 1`] = `Array []`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`"name" option should work: errors 1`] = `Array []`; | ||
|
||
exports[`"name" option should work: module 1`] = ` | ||
"module.exports = function() { | ||
return new Worker(__webpack_public_path__ + \\"my-custom-name.js\\"); | ||
};" | ||
`; | ||
|
||
exports[`"name" option should work: result 1`] = `"{\\"postMessage\\":true,\\"onmessage\\":true}"`; | ||
|
||
exports[`"name" option should work: warnings 1`] = `Array []`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`"publicPath" option should use "__webpack_public_path__" by default: errors 1`] = `Array []`; | ||
|
||
exports[`"publicPath" option should use "__webpack_public_path__" by default: module 1`] = ` | ||
"module.exports = function() { | ||
return new Worker(__webpack_public_path__ + \\"test.worker.js\\"); | ||
};" | ||
`; | ||
|
||
exports[`"publicPath" option should use "__webpack_public_path__" by default: result 1`] = `"{\\"postMessage\\":true,\\"onmessage\\":true}"`; | ||
|
||
exports[`"publicPath" option should use "__webpack_public_path__" by default: warnings 1`] = `Array []`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`"workerType" option should use "Worker" by default: errors 1`] = `Array []`; | ||
|
||
exports[`"workerType" option should use "Worker" by default: module 1`] = ` | ||
"module.exports = function() { | ||
return new Worker(__webpack_public_path__ + \\"test.worker.js\\"); | ||
};" | ||
`; | ||
|
||
exports[`"workerType" option should use "Worker" by default: result 1`] = `"{\\"postMessage\\":true,\\"onmessage\\":true}"`; | ||
|
||
exports[`"workerType" option should use "Worker" by default: warnings 1`] = `Array []`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import src from '../src'; | ||
import cjs from '../src/cjs'; | ||
|
||
describe('cjs', () => { | ||
it('should exported', () => { | ||
expect(cjs).toEqual(src); | ||
}); | ||
}); |
Oops, something went wrong.