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

ESBuild Karma mode run-time errors attributed to built files instead of sources #29129

Open
1 task done
Klaster1 opened this issue Dec 13, 2024 · 0 comments
Open
1 task done

Comments

@Klaster1
Copy link

Command

test

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I noticed that after changing the karma builder mode from browser to application, test failures no longer link to source. Instead, they link to compiled code that is run, making debugging super cumbersome.

Minimal Reproduction

  1. Have a Jasmine/Karma unit test that fails.
  2. Switch the Karma build mode to browser.
  3. Run the test to observe how it was before and what's expected.
  4. Switch to browser mode.
  5. Run the test again to observe the new behavior.

Exception or Error

Initial chunk files         | Names                    |  Raw size
chunk-IOEST5I4.js           | -                        |   2.50 MB | 
spec-hint.component.spec.js | spec-hint.component.spec |   1.08 MB | 
polyfills.js                | polyfills                | 966.41 kB | 
test_main.js                | test_main                | 709.83 kB | 
styles.css                  | styles                   | 410.62 kB | 

                            | Initial total            |   5.67 MB

Application bundle generation complete. [20.621 seconds]

Watch mode enabled. Watching for file changes...
Ignoring framework "@angular-devkit/build-angular" from karma config file because it's not compatible with the application builder.
13 12 2024 12:21:20.592:WARN [karma]: No captured browser, open http://localhost:9876/
13 12 2024 12:21:20.604:INFO [karma-server]: Karma v6.3.17 server started at http://localhost:9876/
13 12 2024 12:21:20.605:INFO [launcher]: Launching browsers ChromiumHeadless with concurrency unlimited
13 12 2024 12:21:20.615:INFO [launcher]: Starting browser ChromiumHeadless
13 12 2024 12:21:21.181:INFO [Chrome Headless 130.0.0.0 (Windows 10)]: Connected on socket 2G57Qwy8WbUCIspWAAAB with id 4372525
Chrome Headless 130.0.0.0 (Windows 10): Executed 0 of 5 SUCCESS (0 secs / 0 secs)
13 12 2024 12:21:21.579:WARN [web-server]: 404: /base/frontend/dist/test-out/579ae25a-dbef-48d6-99f5-403bb0aaf925/media/material-icons-regular.woff2
Chrome Headless 130.0.0.0 (Windows 10) Hint component Opens and closes dialog FAILED
        Expected false to equal true.
            at <Jasmine>
            at Object.<anonymous> (frontend/dist/test-out/579ae25a-dbef-48d6-99f5-403bb0aaf925/spec-hint.component.spec.js:23228:46)
            at Generator.next (<anonymous>)
            at fulfilled (frontend/dist/test-out/579ae25a-dbef-48d6-99f5-403bb0aaf925/chunk-IOEST5I4.js:66:24)
            at _ZoneDelegate.invoke (frontend/dist/test-out/579ae25a-dbef-48d6-99f5-403bb0aaf925/polyfills.js:25701:158)
Chrome Headless 130.0.0.0 (Windows 10): Executed 1 of 5 (1 FAILED) (0 secs / 0.063 secs)
Chrome Headless 130.0.0.0 (Windows 10) Hint component Opens and closes dialog FAILED
        Expected false to equal true.
            at <Jasmine>
            at Object.<anonymous> (frontend/dist/test-out/579ae25a-dbef-48d6-99f5-403bb0aaf925/spec-hint.component.spec.js:23228:46)
            at Generator.next (<anonymous>)
            at fulfilled (frontend/dist/test-out/579ae25a-dbef-48d6-99f5-403bb0aaf925/chunk-IOEST5I4.js:66:24)
Chrome Headless 130.0.0.0 (Windows 10): Executed 5 of 5 (1 FAILED) (0.124 secs / 0.114 secs)
TOTAL: 1 FAILED, 4 SUCCESS
TOTAL: 1 FAILED, 4 SUCCESS

Your Environment

Windows 11, @angular-devkit/build-angular 19.0.5.

Anything else relevant?

Before:

✔ Browser application bundle generation complete.
13 12 2024 12:20:34.432:WARN [karma]: No captured browser, open http://localhost:9876/
13 12 2024 12:20:34.448:INFO [karma-server]: Karma v6.3.17 server started at http://localhost:9876/
13 12 2024 12:20:34.449:INFO [launcher]: Launching browsers ChromiumHeadless with concurrency unlimited
13 12 2024 12:20:34.454:INFO [launcher]: Starting browser ChromiumHeadless
13 12 2024 12:20:35.484:INFO [Chrome Headless 130.0.0.0 (Windows 10)]: Connected on socket e49nbggjwmDXR2yWAAAB with id 23102058
Chrome Headless 130.0.0.0 (Windows 10) Hint component Opens and closes dialog FAILED
        Expected false to equal true.
            at <Jasmine>
            at UserContext.<anonymous> (src/app/common/components/hint/hint.component.spec.ts:67:42)
            at Generator.next (<anonymous>)
            at asyncGeneratorStep (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:3:1)
            at _next (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:17:1)
Chrome Headless 130.0.0.0 (Windows 10): Executed 1 of 5 (1 FAILED) (0 secs / 0.098 secs)
Chrome Headless 130.0.0.0 (Windows 10) Hint component Opens and closes dialog FAILED
        Expected false to equal true.
            at <Jasmine>
            at UserContext.<anonymous> (src/app/common/components/hint/hint.component.spec.ts:67:42)
            at Generator.next (<anonymous>)
            at asyncGeneratorStep (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:3:1)
Chrome Headless 130.0.0.0 (Windows 10): Executed 5 of 5 (1 FAILED) (0.168 secs / 0.153 secs)
TOTAL: 1 FAILED, 4 SUCCESS
TOTAL: 1 FAILED, 4 SUCCESS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants