Skip to content
This repository was archived by the owner on Nov 17, 2022. It is now read-only.

Update testing.md #1931

Merged
merged 2 commits into from
Jan 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions docs/tooling/testing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ QUnit.test("Hello World Sample Test:", function (assert) {
assert.equal( mainViewModel.createViewModel().message, "42 taps left", "Message, 42 taps left; equal succeeds." ); //Assert that the message is "42 taps left".
});
```
{% angular %}
## TestBed Integration

## Angular TestBed Integration

To use TestBed you have to alter your `karma.conf.js` to:
```
Expand Down Expand Up @@ -205,7 +205,6 @@ describe('Renderer E2E', () => {

```

{% endangular%}

## Run Your Tests

Expand Down Expand Up @@ -248,6 +247,12 @@ To execute your test suite in the iOS Simulator, run the following command.
tns test ios --emulator
```

To execute your test suite in CI make sure to add `--justlaunch`. This parameter will exit the simulator.

```Shell
tns test ios --emulator --justlaunch
```

Each execution of `$ tns test` consists of the following steps, performed automatically.

1. The CLI starts a Karma server on the development machine.
Expand Down Expand Up @@ -282,3 +287,4 @@ When you modify `karma.conf.js`, make sure that your changes meet the specificat
## Continuous Integration

To integrate the NativeScript unit test runner into a continuous integration process, you need to configure a Karma reporter, for example, the [JUnit reporter](https://github.com/karma-runner/karma-junit-reporter).