NativeScript / NativeScript/nx

NativeScript application with jest tests are not compatible (nx)

Open
#68 1 comment 2 reactions 0 assignees View on GitHub

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:
imagen

I leave here the repository where you can find this test project: https://github.com/harikasin/nativescript-jest

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.