After upgrading I ran the coverage and got an Unhandled promise rejection at the end of the coverage saying it can't find the file
Would be great to release the versions to match the ones from npm!
Thanks and good job :)
@mbeauchamp7 thanks for reporting this!
Would it be possible for you to create a minimal repo that reproduces this? That'll help:
Hi @kulshekhar ,
I installed version by version untill I pin pointed which version was making this happen and it started at version 19.0.5
I looked at every PRs from that day and my guess is it's coming from the remap-instanbul dependency update. I red the latest release (0.9.5) and they seemed to have changed some stuff with remapping filenames.
Resulting into this : 'C:\Users\<User>\Source\Repos\<RepoName>\<src>\C:\Users\<User>\Source\Repos\<RepoName>\<src>\coverage\remapped\coverage.txt'
(I change the actual names with <>)
So, I changed this line https://github.com/kulshekhar/ts-jest/blob/master/src/coverageprocessor.ts#L54
To this: coverageDirectory: './coverage/',
and it now properly puts the coverage.txt in the remapped folder.
Not sure if that's an optimal solution since in the jest config you can specifiy the coverageDirectory. Maybe parse out the <rootDir>? I have no clue...
Anyways, I hope this is enough info for you to take action! Although this is a very minor issue since it doesn't break anything... (from what I saw)
Cheers
@mbeauchamp7 I've been unable to replicate this issue. I'm closing this now but it can be reopened if there's a way to replicate it.
@kulshekhar Sorry for my incompetence, I don't have much time during the week but I will try to reproduce this weekend.
@mbeauchamp7 that wasn't a comment on you!
I just wanted to document the reason for closing so that anyone who stumbles on this issue can ask that it be reopened!
I'm seeing this issue with the version 19.0.9. It appears to be caused by having any value in thecoverageDirectory configuration value.
It appears that everything still works, it just returns an error in the console:
So no error with this config:
"dependencies": {
"jest": "^19.0.2",
"ts-jest": "^19.0.9",
"typescript": "^2.2.2"
},
"jest": {
"transform": {
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/__tests__/.*|\\.spec)\\.ts$",
"moduleFileExtensions": [
"ts",
"tsx",
"js"
],
"testResultsProcessor": "<rootDir>/node_modules/ts-jest/coverageprocessor.js",
"collectCoverageFrom": [
"src/**/*.ts",
"!src/**/*.spec.ts",
"!src/**/*.d.ts"
]
}
this one throws an error in the command line, but still looks like it works:
"dependencies": {
"jest": "^19.0.2",
"ts-jest": "^19.0.9",
"typescript": "^2.2.2"
},
"jest": {
"transform": {
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/__tests__/.*|\\.spec)\\.ts$",
"moduleFileExtensions": [
"ts",
"tsx",
"js"
],
"testResultsProcessor": "<rootDir>/node_modules/ts-jest/coverageprocessor.js",
"coverageDirectory": "<rootDir>/output/",
"collectCoverageFrom": [
"src/**/*.ts",
"!src/**/*.spec.ts",
"!src/**/*.d.ts"
]
}
And here is the error:
(node:9044) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, open 'C:\src\ts-jest-test\C:\src\ts-jest-test\output\remapped\coverage.txt'
(node:9044) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js
process with a non-zero exit code.
@jcgillespie would it be possible for you to create a minimal repo that demonstrates this issue?
Yeah. I can upload my test repo later this afternoon.
From: Kulshekhar Kabra notifications@github.com
Sent: Sunday, April 16, 2017 12:41:26 AM
To: kulshekhar/ts-jest
Cc: Josh Gillespie; Mention
Subject: Re: [kulshekhar/ts-jest] Upgrading from 19.0.2 to 19.0.6 (#149)
@jcgillespiehttps://github.com/jcgillespie would it be possible for you to create a minimal repo that demonstrates this issue?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/kulshekhar/ts-jest/issues/149#issuecomment-294334931, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABrd-JVavHwJetHCnKxxqs8yRVv-X1Ufks5rwaoGgaJpZM4Mu8On.
Posted a repro repo here
@mbeauchamp7 @jcgillespie The fix for this has been published. Can you folks try it out and confirm that the issue has been fixed?
@kulshekhar I upgraded to 19.0.10 and I don't see the error anymore. 👍
@kulshekhar Looks good to me after upgrading. Thanks!
Most helpful comment
Posted a repro repo here