Ts-jest: Upgrading from 19.0.2 to 19.0.6

Created on 30 Mar 2017  ·  12Comments  ·  Source: kulshekhar/ts-jest

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 . It didn't seem to break the coverage but wanted to let you know. I know there's been a couple of PR's accepted in the last couple of days, but couldn't pinpoint which one it was.

Would be great to release the versions to match the ones from npm!

Thanks and good job :)

Most helpful comment

Posted a repro repo here

All 12 comments

@mbeauchamp7 thanks for reporting this!

Would it be possible for you to create a minimal repo that reproduces this? That'll help:

  • fix this issue
  • create and add tests for this scenario so that it doesn't happen with future changes

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bruk1977 picture bruk1977  ·  3Comments

ozum picture ozum  ·  4Comments

artola picture artola  ·  3Comments

masters3d picture masters3d  ·  4Comments

qm3ster picture qm3ster  ·  3Comments