NativeScript / NativeScript/nx
NativeScript application with jest tests are not compatible (nx)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 68
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
By following the steps you indicate:
npx create-nx-workspace@latest (monorepo with a web app or a typescript app, indifferently)
npm install --save-dev @nativescript/nx.
npx nx g @nativescript/nx:app
Once you have the app created, if you use the command npx nx run <app-name>:test:ios the default NativeScript app created by NativeScript does not use jest, and sends you to start the tests using mocha, jasmine or qunit.
When you change the configuration to use jest (like web app), if you launch the app it doesn't know how to interpret angular modules and imports.
The "moduleResolution" configuration is not able to interpret it correctly so it always fails.
The tests that you have in your repository for the nativesscript application also fail.
These are the errors it gives:

I leave here the repository where you can find this test project: https://github.com/harikasin/nativescript-jest
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with create-nx-workspace, @nativescript/nx, and the generated app, then run npx nx run :test:ios. Compare the default NativeScript test setup with the Jest configuration described in the issue and inspect the linked nativescript-jest repository. Done means the generated NativeScript app's tests run with Jest and correctly interpret Angular modules and imports.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- mobile, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100