Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

npm test fails without running npm run build #104

Closed
sejoker opened this issue Mar 19, 2017 · 3 comments
Closed

npm test fails without running npm run build #104

sejoker opened this issue Mar 19, 2017 · 3 comments

Comments

@sejoker
Copy link
Contributor

sejoker commented Mar 19, 2017

before PR was landed, this worked:

  • npm install
  • npm run bootstrap
  • npm test

now we have to run 3 steps before running test:

  • npm install
  • npm run bootstrap
  • npm run build
  • npm test

I assume it was an intended behavior, on the other hand, we should reflect it in the README and CONTRIBUTING docs. I also think we could move aliasing step outside of the build step and run it within npm run bootstrap.

Another note, after running npm run clean we need again 2 extra steps before able to run tests:

  • npm run bootstrap
  • npm run build
  • npm test
@tajo
Copy link
Contributor

tajo commented Mar 19, 2017

Yea, that's because tests don't use aliasing (or webpack) but they are using symlinks that are created by npm run bootstrap. Those point to the main file and not source file. That's why you need to rebuild packages to be 100% consistent.

However, as far as you work on one component and its tests at the time you don't need to rebuild. Only if you are trying update tests let's say for cf-component-link and changing source of cf-util-route-handler since cf-util-route-handler is a dep of cf-component-link. It's quite an edge case. It doesn't even happen with UI components since they don't link each other. I think it makes sense.

we should reflect it in the README and CONTRIBUTING docs

Yea, it should be updated. You can also see it in .travis.yml.

Another note, after running npm run clean we need again 2 extra steps before able to run tests:

I think it nukes only node_modules, so you you should be fine only with npm run bootstrap.

@sejoker
Copy link
Contributor Author

sejoker commented Mar 19, 2017

@tajo you are right, npm run clear && npm run bootstrap && npm run test works fine.

@sejoker
Copy link
Contributor Author

sejoker commented Mar 22, 2017

updated README.md as part of Yarn migration.

@sejoker sejoker closed this as completed Mar 22, 2017
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