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

configure to allow raw testing of individual files #140

Open
robbiemu opened this issue Jan 14, 2023 · 0 comments
Open

configure to allow raw testing of individual files #140

robbiemu opened this issue Jan 14, 2023 · 0 comments

Comments

@robbiemu
Copy link

Is your feature request related to a problem? Please describe.

I would like to be able to directly test individual files. When setting jest up on my own, I used to be able to: jest ./src/app/app.component.spec.ts

and this comes in handy especially in vscode where I might drag and drop the file directly to the terminal..

now that produces:

Determining test suites to run...
ngcc-jest-processor: running ngcc
FAIL  src/app/app.component.spec.ts
 AppComponent
   ✕ should create the app (3 ms)
   ✕ should have as title 'ang15-test' (6 ms)
   ✕ should render title (1 ms)

 ● AppComponent › should create the app

   Need to call TestBed.initTestEnvironment() first
...

likewise, I cannot call ng test directly with the filename:

ng test ./src/app/app.component.spec.ts

Error: Invalid values:
  Argument: project, Given: "./src/app/app.component.spec.ts", Choices: "ang15-test"

ng test -- ./src/app/app.component.spec.ts
Option '--' has been specified multiple times. The value './src/app/app.component.spec.ts' will be used.
Error: Schema validation failed with the following errors:
  Data path "/" must be array.

Describe the solution you'd like
A clear and concise description of what you want to happen.

I should be able to test specific files directly on the commandline, such as:

jest <filename>

Describe alternatives you've considered
As I've had that working in multiple repos before, I am sure I will be able to figure it out with modern angular 15 now. I just havent located the issue yet.

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

No branches or pull requests

1 participant