NativeScript / NativeScript/nativescript-cli

Cannot run Karma Jasmine test even for HelloWorld

Open
#5,523 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

unit testing
Dominant language
JavaScript
Stars
1.1k
Forks
204
Avg merge
1d 9h
Merged PRs (30d)
8

Description

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
✔ Component nativescript has 8.0.1 version and is up to date.
ns doctor shows all green check marks

Android Runtime: 4.1.3
iOS Runtime: 12.4
XCode Version: 12.4
Plugin(s):
Describe the bug
Cannot run ns test ios or ns test android even it's just the HelloWord template directly from NativeScript WITHOUT one line of code added.

To Reproduce

create a project call HelloWorld ns create HelloWorld
'cd HelloWorld'
ns test init and pick Jasmine
add the following steps to fix some known issues

  • npm install karma-webpack@next --save-dev
  • In karma.conf.js, add webpack to frameworks section frameworks: ['jasmine', 'webpack']
  • In tsconfig.json, add src/tests//*.ts in include section "include": ["src/tests//.ts", "src/**/.ios.ts", "src/**/*.android.ts"],
    'ns test ios' or ns test android

Expected behavior
Test should run and result display on the console

Sample project
https://github.com/cupidchan/HelloWorld

Additional context

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

Start by reproducing ns test ios and ns test android with the linked HelloWorld sample. Read karma.conf.js and tsconfig.json, including the reported Jasmine, webpack, and test-file configuration, and capture the failure output. Done means the HelloWorld template runs its Karma Jasmine tests and displays the result in the console.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, mobile-dev, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.