Cannot Get Angular 17.1 Feature "ng test --no-browsers" To Work

48 views Asked by At

I was told that starting in version 17.1 we could run our unit tests without a browser using "ng test --no-browsers" but I think I am doing something wrong because this only results in starting the server on port 9876. I am using: Angular CLI: 17.1.1 , Node: 18.13.0 , and Package Manager: npm 8.19.3

When I create a new project from scratch, then run the tests with this new feature, this is what I see:

~/bob/git >ng new nobrowserstestproj --routing
? Which stylesheet format would you like to use? CSS
? Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? No
CREATE nobrowserstestproj/README.md (1072 bytes)
CREATE nobrowserstestproj/.editorconfig (274 bytes)
CREATE nobrowserstestproj/.gitignore (548 bytes)
CREATE nobrowserstestproj/angular.json (2652 bytes)
CREATE nobrowserstestproj/package.json (1049 bytes)
CREATE nobrowserstestproj/tsconfig.json (903 bytes)
CREATE nobrowserstestproj/tsconfig.app.json (263 bytes)
CREATE nobrowserstestproj/tsconfig.spec.json (273 bytes)
CREATE nobrowserstestproj/.vscode/extensions.json (130 bytes)
CREATE nobrowserstestproj/.vscode/launch.json (470 bytes)
CREATE nobrowserstestproj/.vscode/tasks.json (938 bytes)
CREATE nobrowserstestproj/src/main.ts (250 bytes)
CREATE nobrowserstestproj/src/favicon.ico (15086 bytes)
CREATE nobrowserstestproj/src/index.html (304 bytes)
CREATE nobrowserstestproj/src/styles.css (80 bytes)
CREATE nobrowserstestproj/src/app/app.component.css (0 bytes)
CREATE nobrowserstestproj/src/app/app.component.html (19903 bytes)
CREATE nobrowserstestproj/src/app/app.component.spec.ts (952 bytes)
CREATE nobrowserstestproj/src/app/app.component.ts (314 bytes)
CREATE nobrowserstestproj/src/app/app.config.ts (227 bytes)
CREATE nobrowserstestproj/src/app/app.routes.ts (77 bytes)
CREATE nobrowserstestproj/src/assets/.gitkeep (0 bytes)
✔ Packages installed successfully.
    Successfully initialized git.

~/bob/git >cd nobrowserstestproj/
✔ ~/bob/git/nobrowserstestproj [master L|✔] 
08:33 $ ng test --no-browsers
✔ Browser application bundle generation complete.
31 01 2024 08:33:39.199:WARN [karma]: No captured browser, open http://localhost:9876/
31 01 2024 08:33:39.219:INFO [karma-server]: Karma v6.4.2 server started at  http://localhost:9876/

` I was expecting the tests to run commandline-style , then get my prompt back. Can someone help a brother out? Thank you.

0

There are 0 answers