question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests are using code from npm instead of code from pull request

See original GitHub issue

Possibly a regression from https://github.com/facebook/create-react-app/commit/5fecfee2373ebd1eda0c405b82a1c2d24afae6a1. Blocking #4837.

Is this a bug report?

Yes

Environment

System: OS: macOS 10.14 CPU: x64 Intel® Core™ 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

  • Fork #4837
  • Run CI=false npx jest --config ./test/jest.config.js --testMatch '<rootDir>/**/typescript/*.test.js' (pass)
  • Run 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

https://github.com/facebook/create-react-app/blob/f89385f7438f39750b762590ebd9729534e30190/test/fixtures/__shared__/util/setup.js#L18

https://github.com/facebook/create-react-app/blob/f89385f7438f39750b762590ebd9729534e30190/test/fixtures/__shared__/util/setup.js#L37-L42

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Timercommented, Oct 15, 2018

The tests are supposed to be using code from “npm” because the PR is published before the test are ran: https://github.com/facebook/create-react-app/blob/f89385f7438f39750b762590ebd9729534e30190/tasks/e2e-behavior.sh#L90-L100

I suspect our registry override might be wiped out, or similar.

0reactions
Timercommented, Oct 15, 2018

Hmm, I’d like to figure out why this doesn’t work with PnP (it should).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Efficient way to test a pull request for an npm package ...
I was wondering what the most efficient way is to test a pull request in an npm module? Imagine the following (quite typical)...
Read more >
Make it easier to install a package from a pull request #39
As a package maintainer I would like contributors to be able to install an npm package from a pull request on the package's...
Read more >
What are Github Actions and How Can You Automate Tests ...
This checks out our code on our job environment so we can use it to run tests. uses: actions/setup-node@v1 : Since we're using...
Read more >
How to add Playwright tests to your pull request CI with GitHub ...
In this article you will learn the basics of how to write end-to-end tests with Playwright, running tests from GitHub Actions, deploying to ......
Read more >
New code definition for Pull request not working - SonarCloud
Template for a good new topic, formatted with Markdown: ALM used GitHub CI system used Github Actions Scanner command used when applicable ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found