You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Coverage fails in dev mode (ember serve) on 2.0.3 #403
From what I can see the only change introduced in 2.0.3 is #387 and after upgrading it fails coverage in our application when running COVERAGE=true ember serve and running tests by visiting http://localhost:4200/tests. It works when running COVERAGE=true ember test.
Our app is running 4.12.3 and isn't using Embroider but I have tried in a branch where we are running Embroider with maximum backward compatibility and it fails in both cases.
I've also tried in a new Ember app (currently 5.5.0) by running ember new ember-code-coverage and getting the same issue.
Works: COVERAGE=true ember test COVERAGE=true ember test --server
Fails: COVERAGE=true ember serve
Getting the same problem if I clone this repo and runs the test in my-app
Error:
TypeError: Cannot destructure property 'root' of 'options' as it is undefined.
at writeCoverage (/Code/ember-code-coverage/node_modules/ember-cli-code-coverage/lib/attach-middleware.js:146:9)
at coverageHandler (/Code/ember-code-coverage/node_modules/ember-cli-code-coverage/lib/attach-middleware.js:191:3)
at /Code/ember-code-coverage/node_modules/ember-cli-code-coverage/lib/attach-middleware.js:206:7
at Layer.handle [as handle_request] (/Code/ember-code-coverage/node_modules/express/lib/router/layer.js:95:5)
at next (/Code/ember-code-coverage/node_modules/express/lib/router/route.js:144:13)
at /Code/ember-code-coverage/node_modules/body-parser/lib/read.js:137:5
at AsyncResource.runInAsyncScope (node:async_hooks:206:9)
at invokeCallback (/Code/ember-code-coverage/node_modules/raw-body/index.js:231:16)
at done (/Code/ember-code-coverage/node_modules/raw-body/index.js:220:7)
at IncomingMessage.onEnd (/Code/ember-code-coverage/node_modules/raw-body/index.js:280:7)
at IncomingMessage.emit (node:events:514:28)
at endReadableNT (node:internal/streams/readable:1589:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Activity
olyckne commentedon Mar 1, 2024
After updating to 2.1.1 the whole Ember application crashes due to this issue.
Tried to investigate a bit and if I revert this change
494396b#diff-220612c243d58fc738e2512fd4efbd91e7700e2b8b547032a3e260df5fb7ee9dL119-R129
it seems to be working again, but I'm not sure why that change was made.
With the current code
If I understand it correctly
ember serveautomatically callsserverMiddlewarebut only withstartOptionswhich will makeconfigundefined.When running
ember test --serverit will usetestemMiddlewarewhich will callserverMiddlewarewith a correctconfigkrasnoukhov commentedon Apr 5, 2024
Nice find @olyckne, created a PR for this, hopefully will get accepted 🙏