Skip to content

Instantly share code, notes, and snippets.

@thw0rted
Created May 14, 2020 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thw0rted/ce452c3d6089d7bc391afff890e0f425 to your computer and use it in GitHub Desktop.
Save thw0rted/ce452c3d6089d7bc391afff890e0f425 to your computer and use it in GitHub Desktop.
First test run errors - html-webpack-plugin
FAIL spec/basic.spec.js (56.793s)
HtmlWebpackPlugin
√ generates a default index.html file for a single entry point (2298ms)
√ properly encodes file names in emitted URIs (598ms)
× properly encodes file names in emitted URIs but keeps the querystring (30018ms)
× generates a default index.html file with multiple entry points (44ms)
√ allows you to specify a custom loader without injection (1199ms)
√ should pass through loader errors (148ms)
√ uses a custom loader from webpacks config (102ms)
√ works when using html-loader (262ms)
√ allows you to specify your own HTML template file (62ms)
√ picks up src/index.ejs by default (77ms)
√ allows you to inject the assets into a given html file (90ms)
√ allows you to inject the assets into the body of the given template (73ms)
√ allows you to inject the assets into the head of the given template (94ms)
√ allows you to inject a specified asset into a given html file (98ms)
√ allows you to inject a specified asset into a given html file (49ms)
√ allows you to use chunkhash with asset into a given html file (64ms)
√ allows you to disable injection (75ms)
√ allows you to specify your own HTML template function (433ms)
√ works with source maps (125ms)
√ handles hashes in bundle filenames (347ms)
√ handles hashes in the directory which has the bundle file (391ms)
√ allows to append hashes to the assets (73ms)
√ allows to append hashes to the assets (61ms)
√ should work with the css extract plugin (657ms)
√ should work with the css extract plugin on windows and protocol relative urls support (#205) (418ms)
√ should allow to add cache hashes to with the css assets (310ms)
√ should allow to add cache hashes to with the css assets (356ms)
√ should allow to add cache hashes to with the css assets (371ms)
√ should allow to add cache hashes to with the css assets (93ms)
√ should allow to add cache hashes to with the css assets (83ms)
√ should inject css files when using the extract text plugin (92ms)
√ should allow to add cache hashes to with injected css assets (93ms)
√ should output xhtml link stylesheet tag (62ms)
√ prepends the publicPath to function (384ms)
√ prepends the publicPath to /some/ (345ms)
√ prepends the publicPath to /some (430ms)
√ prepends the publicPath to /some (386ms)
√ prepends the publicPath to undefined (64ms)
√ prepends the publicPath to undefined (63ms)
√ prepends the publicPath to script src (341ms)
√ handles subdirectories in the webpack output bundles (330ms)
√ handles subdirectories in the webpack output bundles along with a relative path (350ms)
√ handles subdirectories in the webpack output bundles along with a relative path (68ms)
√ handles subdirectories in the webpack output bundles along with a absolute path (416ms)
√ allows you to configure the title of the generated HTML page (99ms)
√ allows you to configure the output filename (84ms)
√ will replace [hash] in the filename with the child compilation hash (84ms)
√ should allow filename in the format of [<hashType>:contenthash:<digestType>:<length>] (177ms)
√ will replace [contenthash] in the filename with a content hash of 32 hex characters (40ms)
√ will replace [templatehash] in the filename with a content hash of 32 hex characters (48ms)
√ allows you to use an absolute output filename (63ms)
√ allows you to use an absolute output filename outside the output path (54ms)
√ allows you to use an relative output filename outside the output path (60ms)
√ will try to use a relative name if the filename is in a subdirectory (63ms)
√ will try to use a relative name if the filename and the script are in a subdirectory (57ms)
√ allows you write multiple HTML files (79ms)
√ should inject js css files even if the html file is incomplete (81ms)
√ exposes the webpack configuration to templates (366ms)
√ fires the html-webpack-plugin-alter-asset-tags event (46ms)
√ allows events to add a no-value attribute (43ms)
√ allows events to remove an attribute by setting it to false (52ms)
√ fires the html-webpack-plugin-after-template-execution event (63ms)
√ fires the html-webpack-plugin-before-emit event (59ms)
√ fires the html-webpack-plugin-after-emit event (57ms)
√ allows to modify the html during html-webpack-plugin-before-emit event (76ms)
√ allows to access all hooks from within a plugin (41ms)
√ allows to modify sequentially the html during html-webpack-plugin-before-emit event by edit the given arguments object (70ms)
√ allows to modify sequentially the html during html-webpack-plugin-before-emit event either by edit the given arguments object or by return a new object in the callback (74ms)
√ allows to modify sequentially the html during html-webpack-plugin-before-emit event by return a new object in the callback (61ms)
√ allows to modify the html during html-webpack-plugin-after-template-execution event (66ms)
√ allows to modify the html during html-webpack-plugin-before-asset-tag-generation event (116ms)
√ fires the events in the correct order (33ms)
√ works with commons chunk plugin (369ms)
√ adds a favicon (72ms)
√ adds a base tag with attributes (73ms)
√ adds a base tag short syntax (74ms)
√ adds a meta tag (58ms)
√ adds a meta tag with short notation (61ms)
√ adds a favicon with publicPath set to /some/ (63ms)
√ adds a favicon with publicPath set to /some (60ms)
√ adds a favicon with publicPath set to some/ (61ms)
√ adds a favicon with publicPath undefined (63ms)
√ adds a favicon with publicPath undefined (58ms)
√ adds a favicon with a publichPath set to /[hash]/ and replaces the hash (424ms)
√ adds a favicon with a publichPath set to [hash]/ and replaces the hash (466ms)
√ adds a favicon with inject enabled (58ms)
√ adds a favicon with xhtml enabled (57ms)
√ shows an error if the favicon could not be load (172ms)
√ adds a manifest (47ms)
√ does not add a manifest if already present (46ms)
√ works with webpack bannerplugin (372ms)
√ shows an error when a template fails to load (170ms)
√ should sort the chunks in auto mode (58ms)
√ should sort the chunks in custom (reverse alphabetical) order (461ms)
√ should sort manually by the chunks (574ms)
√ should add the webpack compilation object as a property of the templateParam object (32ms)
√ should allow to disable template parameters (48ms)
√ should allow to set specific template parameters (78ms)
√ should allow to set specific template parameters using a function (73ms)
√ should allow to set specific template parameters using a async function (89ms)
√ should not treat templateContent set to an empty string as missing (75ms)
√ allows you to inject the assets into the body of the given spaced closing tag template (76ms)
√ allows you to inject the assets into the head of the given spaced closing tag template (69ms)
√ should minify by default when mode is production (45ms)
√ should not minify by default when mode is development (29ms)
√ should minify in production if options.minify is true (38ms)
√ should minify in development if options.minify is true (32ms)
√ should not minify in production if options.minify is false (33ms)
√ should not minify in development if options.minify is false (34ms)
√ should allow custom minify options and not merge them with the defaults (51ms)
√ should allow to inject scripts with a defer attribute (53ms)
√ should allow to inject scripts with a defer attribute to the body (63ms)
√ should allow to inject scripts with a defer in front of styles (94ms)
√ should keep closing slashes from the template (59ms)
√ should allow to use headTags and bodyTags directly in string literals (46ms)
● HtmlWebpackPlugin › properly encodes file names in emitted URIs but keeps the querystring
: Timeout - Async callback was not invoked within the 30000ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 30000ms timeout specified by jest.setTimeout.Error:
117 | });
118 |
> 119 | it('properly encodes file names in emitted URIs but keeps the querystring', done => {
| ^
120 | testHtmlPlugin({
121 | mode: 'production',
122 | entry: path.join(__dirname, 'fixtures/index.js'),
at new Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22)
at Suite.<anonymous> (spec/basic.spec.js:119:3)
● HtmlWebpackPlugin › generates a default index.html file with multiple entry points
expect(received).toBeFalsy()
Received: [Error: EEXIST: file already exists, mkdir 'C:\Workspace\html-webpack-plugin\dist\basic-spec']
28 | outputFile = outputFile || 'index.html';
29 | webpack(webpackConfig, (err, stats) => {
> 30 | expect(err).toBeFalsy();
| ^
31 | const compilationErrors = (stats.compilation.errors || []).join('\n');
32 | if (expectErrors) {
33 | expect(compilationErrors).not.toBe('');
at spec/basic.spec.js:30:17
at finalCallback (node_modules/webpack/lib/Compiler.js:220:39)
at node_modules/webpack/lib/Compiler.js:242:21
at node_modules/webpack/lib/Compiler.js:430:22
at node_modules/neo-async/async.js:2830:7
at done (node_modules/neo-async/async.js:3517:9)
at writeOut (node_modules/webpack/lib/Compiler.js:332:23)
at node_modules/mkdirp/index.js:36:29
at node_modules/mkdirp/index.js:48:53
at callback (node_modules/graceful-fs/polyfills.js:295:20)
PASS spec/caching.spec.js
HtmlWebpackPluginCaching
√ should compile nothing if no file was changed (316ms)
√ should not compile the webpack html file if only a javascript file was changed (131ms)
√ should compile the webpack html file even if only a javascript file was changed if caching is disabled (153ms)
√ should compile the webpack html if the template file was changed (140ms)
√ should not slow down linear (10 plugins should not take 2.5 as much time as a 1 plugin) (169ms)
√ should keep watching the webpack html if only a js file was changed (690ms)
PASS spec/hot.spec.js
HtmlWebpackPluginHMR
√ should not cause errors for the main compilation if hot-reload is active (317ms)
√ should not cause missing hot-reloaded code of the main compilation (176ms)
PASS spec/example.spec.js
HtmlWebpackPlugin Examples
√ appcache example (738ms)
√ custom-template example (196ms)
√ default example (249ms)
√ favicon example (151ms)
√ html-loader example (154ms)
√ inline example (377ms)
√ pug-loader example (301ms)
√ javascript example (145ms)
√ javascript-advanced example (204ms)
√ sort manually example (199ms)
√ template-parameters example (147ms)
--------------------------------------------------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
--------------------------------------------------|----------|----------|----------|----------|-------------------|
All files | 91.39 | 79.05 | 93.01 | 91.34 | |
html-webpack-plugin | 89.04 | 79.52 | 91.36 | 88.97 | |
index.js | 89.04 | 79.52 | 91.36 | 88.97 |... 5,996,997,1007 |
html-webpack-plugin/examples/appcache | 100 | 100 | 100 | 100 | |
webpack.config.js | 100 | 100 | 100 | 100 | |
html-webpack-plugin/examples/custom-template | 100 | 100 | 100 | 100 | |
webpack.config.js | 100 | 100 | 100 | 100 | |
html-webpack-plugin/examples/default | 100 | 100 | 100 | 100 | |
webpack.config.js | 100 | 100 | 100 | 100 | |
html-webpack-plugin/examples/favicon | 100 | 100 | 100 | 100 | |
webpack.config.js | 100 | 100 | 100 | 100 | |
html-webpack-plugin/examples/html-loader | 100 | 100 | 100 | 100 | |
webpack.config.js | 100 | 100 | 100 | 100 | |
html-webpack-plugin/examples/inline | 100 | 100 | 100 | 100 | |
webpack.config.js | 100 | 100 | 100 | 100 | |
html-webpack-plugin/examples/javascript | 100 | 100 | 100 | 100 | |
webpack.config.js | 100 | 100 | 100 | 100 | |
html-webpack-plugin/examples/javascript-advanced | 100 | 100 | 100 | 100 | |
webpack.config.js | 100 | 100 | 100 | 100 | |
html-webpack-plugin/examples/pug-loader | 100 | 100 | 100 | 100 | |
webpack.config.js | 100 | 100 | 100 | 100 | |
html-webpack-plugin/examples/sort-manually | 100 | 100 | 100 | 100 | |
webpack.config.js | 100 | 100 | 100 | 100 | |
html-webpack-plugin/examples/template-parameters | 100 | 100 | 100 | 100 | |
webpack.config.js | 100 | 100 | 100 | 100 | |
html-webpack-plugin/lib | 91.94 | 77.65 | 94.44 | 91.76 | |
cached-child-compiler.js | 90.79 | 79.41 | 100 | 90.54 |... 83,296,317,329 |
child-compiler.js | 90.38 | 58.82 | 84.62 | 90.2 | 59,66,81,127,128 |
chunksorter.js | 90 | 50 | 100 | 88.89 | 28 |
errors.js | 85.71 | 100 | 80 | 85.71 | 18,27 |
file-watcher-api.js | 100 | 50 | 100 | 100 | 11 |
hooks.js | 100 | 100 | 100 | 100 | |
html-tags.js | 100 | 81.25 | 100 | 100 | 31,37,63 |
loader.js | 100 | 100 | 100 | 100 | |
html-webpack-plugin/lib/webpack4 | 100 | 100 | 100 | 100 | |
file-watcher-api.js | 100 | 100 | 100 | 100 | |
--------------------------------------------------|----------|----------|----------|----------|-------------------|
Test Suites: 1 failed, 3 passed, 4 total
Tests: 2 failed, 132 passed, 134 total
Snapshots: 0 total
Time: 64.909s
Ran all test suites.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! html-webpack-plugin@4.3.0 test: `jest --runInBand --verbose --coverage`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the html-webpack-plugin@4.3.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment