-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Unit Testing with ns7 #9346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@mansiTT We're working on a blog post to cover this - targeting for publishing this week or the following. There will be a revised unit testing section in docs on this as well. |
That would be a great help. Thanks |
try doing // you will need this unless you have NativeScript/nativescript-angular#2340 nsTestBedInit(); |
What is the progress? |
https://blog.nativescript.org/unit-testing/index.html A subsequent flavor specific post will be put up as well. |
I created a new project using |
@NathanWalker if you can include also how to configure TestBed that will be great ... I am also facing errors like "Executed 1 of null (1 FAILED) (0.046 secs / 0 secs)" OR "Executed 0 of 0 Succes (0.046 secs / 0 secs)" |
Uh oh!
There was an error while loading. Please reload this page.
tns : 7.0.6
Describe the bug
We are facing issue in integrating unit testing in our codebase. We have followed steps mentioned in the documentation for integrating the unit test framework.
Ref Doc : https://docs.nativescript.org/development-workflow.html#angular-testbed-integration
Imports mentioned in the docs are not compatible with ns7. It keeps giving error.
We have tried updating the imports
from :
import 'nativescript-angular/zone-js/testing.jasmine'
import { nsTestBedInit } from 'nativescript-angular/testing'
nsTestBedInit()
to :
import '@nativescript/zone-js/testing.jasmine'
import { nsTestBedInit } from '@nativescript/angular/testing'
nsTestBedInit()
Its giving error :
CONSOLE LOG: NSUTR: this.error: ReferenceError: Zone is not defined
at /base/src/tests/setup.bundle.js?23f4da92075f9f283030879ef2e337b8e3487aa3
20 04 2021 14:04:28.882:WARN [NativeScript / 14.1 (14.1; iPhone)]: Adapter did not report total number of specs.
NativeScript / 14.1 (14.1; iPhone): Executed 0 of null SUCCESS (0 secs / 0 secs)
NativeScript / 14.1 (14.1; iPhone) /base/src/tests/setup.bundle.js?23f4da92075f9f283030879ef2e337b8e3487aa3 at line 0 FAILED
ReferenceError: Zone is not defined
NativeScript / 14.1 (14.1; iPhone): Executed 1 of null (1 FAILED) (0.003 secs / 0 secs)
TOTAL: 1 FAILED, 0 SUCCESS
The text was updated successfully, but these errors were encountered: