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

Due to nodejs/node#1215 my tests fail in Node v4.0.0 #498

Closed
chrisportela opened this issue Sep 10, 2015 · 7 comments
Closed

Due to nodejs/node#1215 my tests fail in Node v4.0.0 #498

chrisportela opened this issue Sep 10, 2015 · 7 comments

Comments

@chrisportela
Copy link

https://github.com/facebook/jest/blob/master/src/TestRunner.js#L357-L372

Jest uses path.dirname with undefined variables

I commented out the catch in lines 511-540 and got this error:

Failed with unexpected error.
/Users/cp/Code/frontend/src/node_modules/jest-cli/src/jest.js:191
      throw error;
      ^

TypeError: Path must be a string. Received undefined
  at assertPath (path.js:8:11)
  at Object.posix.relative (path.js:494:3)
  at DefaultTestReporter.onTestResult (/Users/cp/Code/frontend/src/node_modules/jest-cli/src/DefaultTestReporter.js:44:12)
  at DefaultTestReporter.IstanbulTestReporter.onTestResult (/Users/cp/Code/frontend/src/node_modules/jest-cli/src/IstanbulTestReporter.js:16:46)
  at onTestResult (/Users/cp/Code/frontend/src/node_modules/jest-cli/src/TestRunner.js:439:39)
  at /Users/cp/Code/frontend/src/node_modules/jest-cli/src/TestRunner.js:510:13
  at process._tickCallback (node.js:356:9)

I'm going to continue trying to figure out a solution because this breaks all my tests in node v4.0.0 right now.

@chrisportela
Copy link
Author

Actually, seems it might be an issue with DefaultTestReporter line 44 where it uses path.relative

For some reason my testResult.testFilePath is undefined. testResult is a string error.

@cpojer
Copy link
Member

cpojer commented Sep 10, 2015

I think there might be a SyntaxError in your code somewhere that is being wrongly recorded. I'll take a look shortly.

@cpojer
Copy link
Member

cpojer commented Sep 10, 2015

Well, the bigger issue in jest is that there is a promise exception that is still getting swallowed somewhere...

@cpojer
Copy link
Member

cpojer commented Sep 10, 2015

Can you run the test that failed alone, without workers? jest MyTest.js or jest --runInBand should do that and give you an appropriate error message while I fix this bug.

@chrisportela
Copy link
Author

I think this is an non-issue. I deleted jest-cli from my node_modules and npm installed again and it runs again. My tests are failing very strangely, but at least they are running and report failing

@cpojer
Copy link
Member

cpojer commented Sep 10, 2015

Thanks! There might have been some caching issues from the upgrade. We should probably wipe away the cache dir if the jest version doesn't match up.

@cpojer cpojer closed this as completed in d13bf52 Sep 10, 2015
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants