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

Karma in application build mode throws "handle multiple spec files with same name" #28915

Open
1 task done
Klaster1 opened this issue Nov 21, 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

18

Description

After setting "buildMode: application" for my Karma unit test setup, I am getting multiple "Two output files share the same path but have different contents" errors. The project contains five independent "data-source.spec.ts" suites, each a service for a different component. I suspect the "-2" suffix does not take this into account.

Suite paths:

  • C:\dev\gmc\modules\frontend\src\app\sql\page-query-statistics\data-source.spec.ts
  • C:\dev\gmc\modules\frontend\src\app\sql\page-running-queries\running-queries-table\data-source.spec.ts
  • C:\dev\gmc\modules\frontend\src\app\alerting\page-notification-channels\data-source.spec.ts
  • C:\dev\gmc\modules\frontend\src\app\monitoring-dashboard\widget-remote-senders\data-source.spec.ts
  • C:\dev\gmc\modules\frontend\src\app\caches\page-partition-distribution\providers\data-source.spec.ts

Minimal Reproduction

  1. Have five unit test suites with the same file name located in different directories.
  2. Configure "buildMode: application".

Exception or Error

X [ERROR] Two output files share the same path but have different contents: data-source.spec.ts-2.js.map
X [ERROR] Two output files share the same path but have different contents: data-source.spec.ts-2.js
X [ERROR] Two output files share the same path but have different contents: data-source.spec.ts-2.js.map
X [ERROR] Two output files share the same path but have different contents: data-source.spec.ts-2.js
X [ERROR] Two output files share the same path but have different contents: data-source.spec.ts-2.js.map
X [ERROR] Two output files share the same path but have different contents: data-source.spec.ts-2.js

Your Environment

Angular CLI: 19.0.0
Node: 20.15.1
Package Manager: npm 10.7.0
OS: win32 x64

Angular: 19.0.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, material, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1900.0
@angular-devkit/build-angular   19.0.0
@angular-devkit/core            19.0.0 (cli-only)
@angular-devkit/schematics      19.0.0
@schematics/angular             19.0.0
rxjs                            7.8.1
typescript                      5.6.3
zone.js                         0.15.0

Anything else relevant?

No response

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