Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: show error message from jest-worker #203

Merged
merged 1 commit into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/TaskRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export default class TaskRunner {
async run(tasks) {
if (this.numberWorkers > 1) {
this.worker = new Worker(workerPath, { numWorkers: this.numberWorkers });

// show syntax error from jest-worker
// https://github.com/facebook/jest/issues/8872#issuecomment-524822081
if (this.worker.getStderr()) this.worker.getStderr().pipe(process.stderr);
}

return Promise.all(
Expand Down
6 changes: 3 additions & 3 deletions test/__snapshots__/TerserPlugin.test.js.snap.webpack5
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ exports[`TerserPlugin buildWarning method 6`] = `null`;
exports[`TerserPlugin should regenerate hash: assets 1`] = `
Object {
"598.598.f269c88a2945c1fb29a1.js": "(window.webpackJsonp=window.webpackJsonp||[]).push([[598],{598:(s,n,p)=>{\\"use strict\\";p.r(n),p.d(n,{default:()=>w});const w=\\"async-dep\\"}}]);",
"AsyncImportExport.d603d450d8015887d00e.js": "(()=>{\\"use strict\\";var e={},r={};function o(t){if(r[t])return r[t].exports;var n=r[t]={exports:{}};return e[t](n,n.exports,o),n.exports}o.m=e,o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((r,t)=>(o.f[t](e,r),r),[])),o.u=e=>e+\\".\\"+e+\\".f269c88a2945c1fb29a1.js\\",o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},o.p=\\"\\",(()=>{var e={988:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var a=new Promise((o,t)=>{n=e[r]=[o,t]});t.push(n[2]=a);var i,s=o.p+o.u(r),u=document.createElement(\\"script\\");u.charset=\\"utf-8\\",u.timeout=120,o.nc&&u.setAttribute(\\"nonce\\",o.nc),u.src=s;var p=new Error;i=t=>{i=()=>{},u.onerror=u.onload=null,clearTimeout(c);var a=(()=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n))return n[1]})();if(a){var s=t&&(\\"load\\"===t.type?\\"missing\\":t.type),d=t&&t.target&&t.target.src;p.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+s+\\": \\"+d+\\")\\",p.name=\\"ChunkLoadError\\",p.type=s,p.request=d,a(p)}};var c=setTimeout(()=>{i({type:\\"timeout\\",target:u})},12e4);u.onerror=u.onload=i,document.head.appendChild(u)}};var r=window.webpackJsonp=window.webpackJsonp||[],t=r.push.bind(r);r.push=function(r){for(var t,a,i=r[0],s=r[1],u=r[3],p=0,c=[];p<i.length;p++)a=i[p],o.o(e,a)&&e[a]&&c.push(e[a][0]),e[a]=0;for(t in s)o.o(s,t)&&(o.m[t]=s[t]);for(u&&u(o),n&&n(r);c.length;)c.shift()()};var n=t})(),o.e(598).then(o.bind(o,598)).then(()=>{console.log(\\"Good\\")})})();",
"importExport.8deb6b94a7f006da83b9.js": "(()=>{\\"use strict\\"})();",
"AsyncImportExport.20dd5a01f5bf08dbc6c1.js": "(()=>{\\"use strict\\";var e={},r={};function o(t){if(r[t])return r[t].exports;var n=r[t]={exports:{}};return e[t](n,n.exports,o),n.exports}o.m=e,o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((r,t)=>(o.f[t](e,r),r),[])),o.u=e=>e+\\".\\"+e+\\".f269c88a2945c1fb29a1.js\\",o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},o.p=\\"\\",(()=>{var e={988:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var a=new Promise((o,t)=>{n=e[r]=[o,t]});t.push(n[2]=a);var i,s=o.p+o.u(r),u=document.createElement(\\"script\\");u.charset=\\"utf-8\\",u.timeout=120,o.nc&&u.setAttribute(\\"nonce\\",o.nc),u.src=s;var p=new Error;i=t=>{i=()=>{},u.onerror=u.onload=null,clearTimeout(c);var a=(()=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n))return n[1]})();if(a){var s=t&&(\\"load\\"===t.type?\\"missing\\":t.type),d=t&&t.target&&t.target.src;p.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+s+\\": \\"+d+\\")\\",p.name=\\"ChunkLoadError\\",p.type=s,p.request=d,a(p)}};var c=setTimeout(()=>{i({type:\\"timeout\\",target:u})},12e4);u.onerror=u.onload=i,document.head.appendChild(u)}};var r=window.webpackJsonp=window.webpackJsonp||[],t=r.push.bind(r);r.push=function(r){for(var t,a,i=r[0],s=r[1],u=r[3],p=0,c=[];p<i.length;p++)a=i[p],o.o(e,a)&&e[a]&&c.push(e[a][0]),e[a]=0;for(t in s)o.o(s,t)&&(o.m[t]=s[t]);for(u&&u(o),n&&n(r);c.length;)c.shift()()};var n=t})(),o.e(598).then(o.bind(o,598)).then(()=>{console.log(\\"Good\\")})})();",
"importExport.d938eb9e9df24afaa8d2.js": "(()=>{\\"use strict\\"})();",
"js.0ec4c136cd66a3cda54a.js": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();",
"mjs.d62bda6aebbfc0328d92.js": "(()=>{var r={631:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(631)})();",
}
Expand Down Expand Up @@ -210,7 +210,7 @@ Object {
"assetEmitted": 0,
"beforeCompile": 0,
"beforeRun": 1,
"compilation": 45,
"compilation": 47,
"compile": 0,
"contextModuleFactory": 0,
"done": 1,
Expand Down
Loading