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

Jest for /libs and /xplat #185

Merged
merged 15 commits into from
Mar 26, 2020
Merged

Jest for /libs and /xplat #185

merged 15 commits into from
Mar 26, 2020

Conversation

dmitryr117
Copy link
Contributor

@dmitryr117 dmitryr117 commented Mar 20, 2020

I am working on making Jest to be used as test suite across the board because NX uses Jest by default and Xplat setup these days is suffering from issues when trying to run tests in NX workspace with Xplat.

Fixes:

  1. Configured Jest to run tests for /libs and /xplat

  2. Had to change yarn run test files to test for jest config files rather than karma files

  3. Commented out original .spec.ts workspace test file contents and added generic tests
    to /xplat and angular web apps to make sure Jest just works for now. Tests inside
    /libs were left untouched and are passing ok.

Issues:

  1. Currently after setup "jest-jasmine2" npm package has to be added manually, and
    "jest-preset-angular" npm package has to be set to "^8.0.0" manually inside workspace
    root package.json

  2. When local verdaccio hosted @nstudio package dependencies are set to "*" instead of real version inside
    package.json files, which are located inside inside /packages/[package-name] folders - it results
    in error when trying to run "nx generate app". Error is as follows:
    Package "" refers to a non-existing file '"/home/[home-folder]/dev/xplat-tests/angular"'
    If real versions are set inside /packages/[packagename]/package.json files - this error
    does not occur.

closes #170

Testing if pull request works from main branch to contributor branch
@NathanWalker
Copy link
Member

@dmitryr117 great work here 👏
I saw your comment on the other issue and greatly appreciate this. Having on this PR will help allow me to give it a run. I'll take a look this weekend to see if I can push some additional fixes to help get this wrapped up.

@dmitryr117
Copy link
Contributor Author

@NathanWalker I also updated the way .travis.yml works. There seems to have been an issue with TravisCI default setup. Basically Yarn was some old version, 1.3.2 I think, and was crashing test builds. I changed the system to instead use a Docker container based on ubuntu:18.04 image with Node 12.x, and latest Yarn. Now everything seems to work, and tests are passing ok.

@NathanWalker
Copy link
Member

@dmitryr117 fantastic work! Let's plan to merge this on Wednesday towards end of day PST. I want to run it locally to confirm a few things and will post an update with this. 🤗

chore(core): cleaned up comments in scripts/docker-npm-setup.sh
Cleaned up comments in scripts/docker-npm-setup.sh
@NathanWalker
Copy link
Member

I added the root dependency handlers for jest-jasmine2 and jest-preset-angular as well as fixed up some other dependency issues - Will push changes for merge shortly.

@NathanWalker NathanWalker merged commit aaaae83 into nstudio:master Mar 26, 2020
@NathanWalker
Copy link
Member

This is published now in 9.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jest and Karma conflict issue
2 participants