-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Tests are using code from npm instead of code from pull request #5440
Comments
The tests are supposed to be using code from "npm" because the PR is published before the test are ran: create-react-app/tasks/e2e-behavior.sh Lines 90 to 100 in f89385f
I suspect our registry override might be wiped out, or similar. |
https://travis-ci.org/facebook/create-react-app/jobs/441577719#L606-L709 this looks suspicious. Nothing but |
I made the wrong diagnostic about the problem because locally I ran jest directly so it didn't make this publish to the local npm. I added a console.log to see the real test error on travis: https://travis-ci.org/facebook/create-react-app/jobs/441692012#L787-L797 (btw I wish it showed this by default): FAIL fixtures/typescript/index.test.js (25.768s)
● Console
console.error fixtures/typescript/index.test.js:7
{ Error: Command failed: yarnpkg test --env node --ci
FAIL src/App.test.ts
● Test suite failed to run
Cannot find module './App' from 'App.test.ts'
> 1 | import App from './App'; It loaded |
Adding |
Hmm, I'd like to figure out why this doesn't work with PnP (it should). |
Possibly a regression from 5fecfee.
Blocking #4837.
Is this a bug report?
Yes
Environment
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
Binaries:
Node: 8.11.4 - /usr/local/bin/node
Yarn: 1.10.1 - ~/.yarn/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Browsers:
Chrome: 69.0.3497.100
Firefox: 59.0.2
Safari: 12.0
npmPackages:
@stiligita/react: 1.0.0-0
@types/react: 16.4.14
@types/react-dom: 16.0.8
react: 16.5.2
react-dom: 16.5.2
react-scripts: 2.0.5 (#4837)
npmGlobalPackages:
create-react-app: Not Found (#4837)
Steps to Reproduce
CI=false npx jest --config ./test/jest.config.js --testMatch '<rootDir>/**/typescript/*.test.js'
(pass)CI=true npx jest --config ./test/jest.config.js --testMatch '<rootDir>/**/typescript/*.test.js'
(fail)Expected Behavior
Tests should pass because they are correct.
CRA should use the current code of each pull request, not a version from npm.
Actual Behavior
TypeScript tests fails because it tries to use the cra version from npm, which doesn't support typescript.
Reproducible Demo
#4837
Possibly related code
create-react-app/test/fixtures/__shared__/util/setup.js
Line 18 in f89385f
create-react-app/test/fixtures/__shared__/util/setup.js
Lines 37 to 42 in f89385f
The text was updated successfully, but these errors were encountered: