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

Add better dev/test instructions in CONTRIBUTING.md #1173

Closed
jack-lewin opened this issue Sep 27, 2017 · 3 comments
Closed

Add better dev/test instructions in CONTRIBUTING.md #1173

jack-lewin opened this issue Sep 27, 2017 · 3 comments
Labels

Comments

@jack-lewin
Copy link
Contributor

Hi,

I'm hoping to contribute to enzyme, but I'm having trouble running the test suite. Not sure if I've missed anything with the setup, but I'd appreciate some help getting up and running! Thanks a lot.

Steps taken:

  1. git clone https://github.com/airbnb/enzyme
  2. cd enzyme
  3. npm install
  4. npm run react:15 - this waits for ~10 secs, and then exits without feedback. Not sure whether that's the issue?
  5. npm test fails, with a linter error.

Error message:

/path/to/enzyme/packages/enzyme-adapter-react-15/src/ReactFifteenAdapter.js

lerna ERR! execute   10:31  error  Unable to resolve path to module 'enzyme'                import/no-unresolved
lerna ERR! execute   10:31  error  Missing file extension for "enzyme"                      import/extensions
lerna ERR! execute   20:8   error  Unable to resolve path to module 'enzyme-adapter-utils'  import/no-unresolved
lerna ERR! execute   20:8   error  Missing file extension for "enzyme-adapter-utils"        import/extensions

List of globally-installed packages:

├── create-react-app@1.4.1
├── eslint@4.7.2
├── eslint-plugin-import@2.7.0
├── jest@21.2.0
├── lerna@2.2.0
├── npm@5.4.2
├── serve@6.1.0
├── standard@10.0.3
└── yarn@1.1.0
@lelandrichardson
Copy link
Collaborator

Hey @jack-lewin, you're right - we should add some steps to the contributing guide.

Due to our repo structure and hard to explain things, our test suite currently runs on built enzyme. This means you need to run npm run build before running the test suite.

If you are actively developing, the workflow I recommend is to run npm run build:watch in one terminal, and npm run test:watch in another terminal. This should provide you with ~realtime feedback.

@lelandrichardson lelandrichardson changed the title npm run test fails for new clone Add better dev/test instructions in CONTRIBUTING.md Sep 27, 2017
@jack-lewin
Copy link
Contributor Author

@lelandrichardson thanks for clearing that up - I've got it built & running now. I'll put in a PR for the docs over the weekend!

@ljharb
Copy link
Member

ljharb commented Sep 1, 2018

Merged in #1207.

@ljharb ljharb closed this as completed Sep 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants