Skip to content

Not able to configure a module from TestBed.configureTestingModule #2814

Closed

Description

@ignaciolarranaga

Please, provide the details below:

Tell us about the problem

I can not configure a testing module, on the start of the tests it throws:

NativeScript / 9.1 (9.1; iPhone)  ../../tests/shared/services/user.service.spec.js at line 0 FAILED
    ReferenceError: Can't find variable: Zone
NativeScript / 9.1 (9.1; iPhone): Executed 1 of 0 (1 FAILED) ERROR (0.033 secs / 0 secs)

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

  • CLI: 2.3.0
  • Cross-platform modules:
    tns-core-modules: 2.3.0
  • Runtime(s): ios 2.3.0

Please tell us how to recreate the issue in as much detail as possible.

Just try to configure a test module

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

import { TestBed } from "@angular/core/testing";
import { NativeScriptModule } from "nativescript-angular/platform";
import { NativeScriptFormsModule } from "nativescript-angular/forms"
import { NativeScriptHttpModule } from "nativescript-angular/http";
import { UserService } from "../../../shared/services";
import { IdentifiedHttp } from "../../../shared/util";

describe("UserService tests", () => {
    beforeEach(() => {
        TestBed.configureTestingModule({
            imports: [
                NativeScriptModule,
                NativeScriptFormsModule,
                NativeScriptHttpModule,
            ],
            declarations: [ UserService ],
            providers: [ IdentifiedHttp ]
        });
    });
});

Activity

  1. tsonevn commented on Sep 29, 2016

    @tsonevn
    Contributor
  2. lock commented on Aug 29, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  3. locked and limited conversation to collaborators on Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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