Skip to content

NativeScript application with jest tests are not compatible (nx) #68

Open
@harikasin

Description

@harikasin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions