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

Add support for projects structure #11

Closed
ChristianKohler opened this issue May 15, 2019 · 3 comments · Fixed by #41
Closed

Add support for projects structure #11

ChristianKohler opened this issue May 15, 2019 · 3 comments · Fixed by #41

Comments

@ChristianKohler
Copy link

Is your feature request related to a problem? Please describe.
We have the following folder structure generated with the cli using this commands:

ng new jesttest2 --create-application=false --style=css --routing=false --directory=./

ng generate application jesttest2 --style=css  

When we then run the schematics it sets the root path to 'src'

Describe the solution you'd like
Add jest config to project

Describe alternatives you've considered
Do it manually

Additional context
Folderstructure after schematic:add

Screenshot 2019-05-15 at 11 55 36

@schuchard
Copy link
Collaborator

Hi @ChristianKohler, unfortunately this is expected. Currently this schematic doesn't account for the possibility of multiple projects/applications or libraries. This will need to be a future improvement that relies on the angular.json mappings to add correct Jest setup. We'll keep this issue open as a reminder. Thanks for reporting.

schuchard added a commit that referenced this issue Sep 2, 2020
Add support single application projects and workspaces with apps and libraries. 

## Jest runner

Replace the direct reliance on [`jest-preset-angular`](https://github.com/thymikee/jest-preset-angular) and package json scripts in favor of [`angular-builders/jest`](https://github.com/just-jeb/angular-builders/tree/master/packages/jest). This provides the ability to run tests with `ng test`

This should address #30 #28 #22 #11 
It better positions us to support #1 

## Jest types

Update each projects `tsconfig.spec.json` to configure the `jest` types while removing `jasmine`

This should address #24 #14

## Other
Non-user facing changes 

- refactor development scripts from `package.json` to TS file
- create 2 sandboxes (single app and workspace with app and lib)
- test both sandboxes during CI
- add MIT license
- add prettier
@schuchard
Copy link
Collaborator

Please see if ng add @briebug/[email protected] solves the issue

@ChristianKohler
Copy link
Author

Yes it works 👍 Thank you @schuchard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants