Closed QuantariusRay closed 2 years ago
Hi @QuantariusRay , can you also share your tsconfig file?
./projects/-/tsconfig.app.json
Hey! Thanks for the quick response time! Here is the tsconfig.app as well as the tsconfig.
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"downlevelIteration": true,
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"resolveJsonModule": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
],
"paths": {
"@-/loads-shared": [
"dist/shared"
],
"@-/-": [
"dist/messaging-shared"
],
"@-/-/*": [
"dist/messaging-shared/*"
],
"@-/-": [
"dist/support"
],
"@-/-": [
"dist/driver-messaging"
]
}
},
"editor.codeActionsOnSave": {
"source.fixAll.tslint": true
},
"angularCompilerOptions": {
"disableTypeScriptVersionCheck": true
},
"exclude": ["./cypress"]
}
Hmmm interesting. the file should be included if I follow normal "tsc practices". Could you try to run this command? Does that work?
npx tsc -b ./projects/-/tsconfig.app.json
Seems to work. It blinks for a few and then opens a new command line.
Let me post-face this. We are just adding this to a very large project. Instead of focusing all tests, I'm focusing it on a single directory through my test.ts
file. Is there a better way of isolating this instead of mutating a particular directory?
To focus on a small part, try to change the "mutate" property. Try to focus that on a couple of files first. Without checkers
, just to see if that works.
After that, you should be able to add the "checkers": ["typescript"]
. If you get the same error, try to see if you can run tsc
with --listFilesOnly
(https://www.typescriptlang.org/docs/handbook/compiler-options.html#compiler-options). I haven't tried this myself, but it seems to come in handy here.
npx tsc --listFilesOnly -p ./projects/-/tsconfig.app.json
It should list all included files. See I the file the TypeScript checker is complaining about missing a watcher is in the list. If so, please try to create a small reproduction project (the smaller the better) and upload it here.
Okay, running it without "checkers": ["typescript"]
worked as great as I could expect, I think. I think it still attempted to test everything? I can't really make out what happened, but it did print out a report.
I then added the checkers and got the same error, so I did the --listFilesOnly and got a print out of all of the files and sure enough, the file does show up in the list. I'm not sure how I'd be able to upload the project. It's massive. Would it be possible to do a zoom share or something or any other snippet I could potentially upload?
I think it still attempted to test everything? I can't really make out what happened, but it did print out a report.
Stryker will run an initial test run (dry run) to figure out which tests are covering which mutant. But during actual mutation testing, it will only run the exact tests needed for each mutant (and skip mutants without any coverage). This works because you've configured "coverageAnalysis": "perTest"
(also the default), which is the most performant approach you always want to use.
I'm not sure how I'd be able to upload the project. It's massive.
Could you try to create a new angular project and then create some of the files that you now have? For example, create ./projects/-/tsconfig.app.json
and projects/-/src/app/app-routing.module.ts
. The implementation can be a dummy one. Try if that reproduces the issue. If not, start copy over more (tsconfig.json config, etc) until it can be reproduced. Once you're done you can zip the project (without node_modules) and upload it here.
Sorry to ask that from you, but without being able to reproduce an issue, it is really difficult to fix it.
Okay sounds good. I'll try to get as much of it copied over as possible.
I'll try to get as much of it copied over as possible.
The idea is to copy as little as possible 😉. Just enough to reproduce this issue is fine.
EDIT: I'm assuming this is a closed source project. If it is open source, a URL to the repo is enough for me.
It is closed, but I did get the green light to share with you as long as there is no security stuff passed off. But I think just picking apart the things that are causing my issue is easy enough.
I haven't knocked this out yet, but its still coming!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I had this error, in my case it was because I deleted the reports folder where stryker-incremental.json is located. I was able to grab it from my repository and include it back in the project and then it worked
Summary
Getting an error in a large Angular project that states
Error: Tried to check file "/Users/jisaecx/WebstormProjects/-/projects/-/src/app/app-routing.module.ts" (which is part of your typescript project), but no watcher is registered for it. Changes would go unnoticed. This probably means that you need to expand the files that are included in your project.
Stryker config
Test runner config
Karma
Stryker environment
Your Environment Running on Mac
stryker.log
I may have missed some things. But I feel like there isn't anything out of the ordinary here. The tests run, but the stryker portion isn't actually running.
This seems to be coming from the @stryker-mutator/typescrpt-checker.