-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(progess): emit progress-update #2498
Conversation
@@ -31,11 +31,13 @@ module.exports = class WebsocketServer extends BaseServer { | |||
const noop = () => {}; | |||
|
|||
setInterval(() => { | |||
this.wsServer.clients.forEach((ws) => { | |||
if (ws.isAlive === false) return ws.terminate(); | |||
this.wsServer.clients.forEach((socket) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed by eslint
Codecov Report
@@ Coverage Diff @@
## master #2498 +/- ##
==========================================
+ Coverage 93.57% 93.58% +0.01%
==========================================
Files 34 34
Lines 1322 1325 +3
Branches 380 381 +1
==========================================
+ Hits 1237 1240 +3
Misses 83 83
Partials 2 2
Continue to review full report at Codecov.
|
|
||
if (this.listeningApp) { | ||
this.listeningApp.emit('progress-update', { percent, msg }); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need check this.listeningApp
? Is can be undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this condition because this.setupProgressPlugin is called before this.createServer.
。◕ˇ_ˇ◕。 ~/p/w/webpack-dev-server (feature/emit-progress-update| 🎃 1 📦 1) ᐅ npm run test:only -- progress-option
> [email protected] test:only /Users/hiroppy/programming/webpack/webpack-dev-server
> jest --forceExit "progress-option"
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 3.755s
Ran all test suites matching /progress-option/i.
Force exiting Jest: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished?
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test:only: `jest --forceExit "progress-option"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test:only script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/hiroppy/.npm/_logs/2020-04-03T10_59_27_800Z-debug.log
> npm run test:only -- progress-option
> [email protected] test:only /Users/hiroppy/programming/webpack/webpack-dev-server
> jest --forceExit "progress-option"
console.info node_modules/webpack-log/src/loglevel/PrefixFactory.
js:55
ℹ 「wds」: Project is running at http://localhost:8134/
console.info node_modules/webpack-log/src/loglevel/PrefixFactory.js:55
ℹ 「wds」: webpack output is served from undefined
console.info node_modules/webpack-log/src/loglevel/PrefixFactory.js:55
ℹ 「wds」: Content not from webpack is served from /Users/hiroppy/programming/webpack/webpack-dev-server
PASS test/server/progress-option.test.js
progress
output
✓ should show percentage progress without profile data (570ms
)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 2.107s
Ran all test suites matching /progress-option/i.
Force exiting Jest: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished?
This log shows 2 situations that are added if
or not.
closes: #1666
For Bugs and Features; did you add new tests?
yes
Motivation / Use-Case
Emit
progress-update
event.Breaking Changes
no
Additional Info