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

ng test and two source folders #6371

Closed
netTrek opened this issue May 18, 2017 · 6 comments
Closed

ng test and two source folders #6371

netTrek opened this issue May 18, 2017 · 6 comments
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity3: broken

Comments

@netTrek
Copy link

netTrek commented May 18, 2017

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.0.3
node: 7.5.0
os: darwin x64

macOS (Sierra?)

Repro steps.

  • create new projekt with cli
  • edit tsconfig to work with two source folders
    "paths": {
    "@modules/": [ "../@modules/" ]
    }
  • use new karma test context for both folder
    const context = require.context('../', true, //(@modules|src)/./..spec.ts$/);
  • run 'ng test'

The log given by the failure.

I’m working with two source folders. Therefore I have implemented the context, in order that tests will be searched in two folders.

const context = require.context('../', true, //(@modules|src)/./..spec.ts$/);

If I’m starting ng test, only tests from src run. If I start the test again through a watcher, all tests are found. It is crazy, that an abort with „Error in“ comes with the third reload and with the fourth reload everything is found again and running. These two conditions repeat with every other reload. Can I use ng test only with every „straight“ run reliably? Could be difficult to define in my Jenkins environment.

BTW: Whenever the tests are not in the default source folder. No tests will be found
see http://stackoverflow.com/questions/44047895/karma-finds-no-test-files-on-start-but-finds-every-file-when-reloading/44052076#44052076 also.

Desired functionality.

All test-files should be found

Mention any other details that might be useful.

THX Saban

@Brocco
Copy link
Contributor

Brocco commented May 18, 2017

Can you please provide some steps to reproduce this issue? Ideally this would be via a github repo.

@Brocco Brocco added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity3: broken labels May 18, 2017
@netTrek
Copy link
Author

netTrek commented May 18, 2017 via email

@netTrek
Copy link
Author

netTrek commented May 18, 2017

In my case it works, when I move die @modules folder inside die src folder.
See: https://github.com/netTrek/angular-cli-issues/tree/works
But it would be much cooler, when we could use more then one source folders.

@filipesilva
Copy link
Contributor

@netTrek we don't directly support that usecase and there's a fair number of things that can go wrong with it from a setup point of view.

There's some limited support for multiple apps (https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/multiple-apps.md), but currently no support for libraries (#1692).

@filipesilva
Copy link
Contributor

I should mention that with 1.1.0-rc.0 a new test plugin was introduced which may (or may not) help in your usecase.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity3: broken
Projects
None yet
Development

No branches or pull requests

3 participants