zone.js still refered to in test files

Open Beginner friendly
#366 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
angular, bun, typescript

Research direction

Start by reading src/test-setup.ts and the listed service spec files that import zone.js, then check the zoneless commit and test configuration. Run bun run test to confirm the missing import failure. Remove or update the obsolete test setup references consistently, and consider the issue done when the test suite runs successfully.

Written by the indexing model from the issue text.

Description

In commit 1e2b466 ("zoneless", 2026-01-27) zone.js was removed from package.json, component and directive files, however many test files still refer to it,

$ git grep zone.js src
src/app/core/auth/services/jwt.service.spec.ts:import 'zone.js';
src/app/core/auth/services/jwt.service.spec.ts:import 'zone.js/testing';
src/app/core/auth/services/user.service.spec.ts:import 'zone.js';
src/app/core/auth/services/user.service.spec.ts:import 'zone.js/testing';
src/app/features/article/services/articles.service.spec.ts:import 'zone.js';
src/app/features/article/services/articles.service.spec.ts:import 'zone.js/testing';
src/app/features/article/services/comments.service.spec.ts:import 'zone.js';
src/app/features/article/services/comments.service.spec.ts:import 'zone.js/testing';
src/app/features/article/services/tags.service.spec.ts:import 'zone.js';
src/app/features/article/services/tags.service.spec.ts:import 'zone.js/testing';
src/app/features/profile/services/profile.service.spec.ts:import 'zone.js';
src/app/features/profile/services/profile.service.spec.ts:import 'zone.js/testing';
src/test-setup.ts:import 'zone.js';
src/test-setup.ts:import 'zone.js/testing';

and attempting to run tests fails:

$ bun run test
$ vitest

 DEV  v4.1.6 C:/git/github/angular-realworld-example-app

 ❯ src/app/core/auth/services/jwt.service.spec.ts (0 test)
 ❯ src/app/features/article/services/articles.service.spec.ts (0 test)
 ❯ src/app/features/article/services/comments.service.spec.ts (0 test)
 ❯ src/app/core/auth/services/user.service.spec.ts (0 test)
 ❯ src/app/features/article/services/tags.service.spec.ts (0 test)
 ❯ src/app/features/profile/services/profile.service.spec.ts (0 test)

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Suites 6 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 FAIL  src/app/core/auth/services/jwt.service.spec.ts [ src/app/core/auth/services/jwt.service.spec.ts ]
 FAIL  src/app/features/article/services/comments.service.spec.ts [ src/app/features/article/services/comments.service.spec.ts ]
Error: Failed to resolve import "zone.js" from "src/test-setup.ts". Does the file exist?
  Plugin: vite:import-analysis
  File: C:/git/github/angular-realworld-example-app/src/test-setup.ts:1:7
  1  |  import "zone.js";
     |          ^
  2  |  import "zone.js/testing";
  3  |  import { getTestBed } from "@angular/core/testing";
 ❯ TransformPluginContext._formatLog node_modules/vite/dist/node/chunks/config.js:29003:43
 ❯ TransformPluginContext.error node_modules/vite/dist/node/chunks/config.js:29000:14
 ❯ normalizeUrl node_modules/vite/dist/node/chunks/config.js:27123:18
 ❯ node_modules/vite/dist/node/chunks/config.js:27181:32
 ❯ TransformPluginContext.transform node_modules/vite/dist/node/chunks/config.js:27149:4
 ❯ EnvironmentPluginContainer.transform node_modules/vite/dist/node/chunks/config.js:28801:14
 ❯ loadAndTransform node_modules/vite/dist/node/chunks/config.js:22670:26

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/6]⎯

 FAIL  src/app/core/auth/services/user.service.spec.ts [ src/app/core/auth/services/user.service.spec.ts ]
 FAIL  src/app/features/article/services/articles.service.spec.ts [ src/app/features/article/services/articles.service.spec.ts ]
 FAIL  src/app/features/article/services/tags.service.spec.ts [ src/app/features/article/services/tags.service.spec.ts ]
 FAIL  src/app/features/profile/services/profile.service.spec.ts [ src/app/features/profile/services/profile.service.spec.ts ]
Error: Failed to resolve import "zone.js" from "src/test-setup.ts". Does the file exist?
  Plugin: vite:import-analysis
  File: C:/git/github/angular-realworld-example-app/src/test-setup.ts:1:7
  1  |  import "zone.js";
     |          ^
  2  |  import "zone.js/testing";
  3  |  import { getTestBed } from "@angular/core/testing";
 ❯ TransformPluginContext._formatLog node_modules/vite/dist/node/chunks/config.js:29003:43
 ❯ TransformPluginContext.error node_modules/vite/dist/node/chunks/config.js:29000:14
 ❯ normalizeUrl node_modules/vite/dist/node/chunks/config.js:27123:18
 ❯ node_modules/vite/dist/node/chunks/config.js:27181:32
 ❯ TransformPluginContext.transform node_modules/vite/dist/node/chunks/config.js:27149:4
 ❯ EnvironmentPluginContainer.transform node_modules/vite/dist/node/chunks/config.js:28801:14
 ❯ loadAndTransform node_modules/vite/dist/node/chunks/config.js:22670:26
 ❯ fetchModule node_modules/vite/dist/node/chunks/config.js:33997:15

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/6]⎯


 Test Files  6 failed (6)
      Tests  no tests
   Start at  15:40:10
   Duration  2.88s (transform 0ms, setup 0ms, import 0ms, tests 0ms, environment 6.45s)

 FAIL  Tests failed. Watching for file changes...

Has nobody run test since March and noticed that it is failing?

Dominant language
TypeScript
Stars
5.7k
Forks
3.5k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from realworld-apps/angular-realworld-example-app

All issues in realworld-apps/angular-realworld-example-app

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.