Comments (5)
Dear,
You have imported MDBBootstrapModule, however you didn't add it to imports: [...] section.
Please follow installation guide carefully or check demo app (app.module file).
from mdb-angular-ui-kit.
Excuse me but I talked about the unit test not about my app-module. My app is working well :)
As you can see I posted my .spec.ts. If I import the MDBBootstrapModule into my spec files, im receiving a different error message:
/Users/danielsogl/Documents/DHBW Projekt 2017/dhbw-projekt-app/node_modules/angular-bootstrap-md/index.ts:2
import { ModuleWithProviders, NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
^^^^^^
SyntaxError: Unexpected token import
from mdb-angular-ui-kit.
If you want to test you should also import module inside your .specs.ts . Regarding new issue, could you please check with Angular 5.0.2 or 5.0.3, there are few known issues with the newest release.
Please also make sure that you have added mdb to compilation path in ts.config.json, but I assume you did if the application works fine.
from mdb-angular-ui-kit.
My dependencies are up to date (Angular 5.0.3). I don't have problems with my unit tests with the mdb-navbar for example and I don't have to import the MDBBootstrapModule into that unit test as you can see in this unit-test spec file.
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AngularFireModule } from 'angularfire2';
import { AngularFireAuth } from 'angularfire2/auth';
import { AngularFirestore, AngularFirestoreModule } from 'angularfire2/firestore';
import { environment } from '../../../environments/environment';
import { FirebaseAuthService } from '../../services/auth/firebase-auth/firebase-auth.service';
import { NavigationBarComponent } from './navigation-bar.component';
describe('NavigationBarComponent', () => {
let component: NavigationBarComponent;
let fixture: ComponentFixture<NavigationBarComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule,
AngularFireModule.initializeApp(environment.firebase)
],
providers: [
FirebaseAuthService,
AngularFireAuth,
{ provide: AngularFirestore, depends: AngularFirestoreModule }
],
declarations: [NavigationBarComponent],
schemas: [NO_ERRORS_SCHEMA]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(NavigationBarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
And to answer your last question, here is my tsconfig file.
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
},
"include": ["node_modules/angular-bootstrap-md/**/*.ts", "src/**/*.ts"]
}
This is my spec file WITH the MDBBootstrapModule with the described error in my comment before.
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { MDBBootstrapModule } from 'angular-bootstrap-md';
import { AngularFireModule } from 'angularfire2';
import { AngularFireAuth } from 'angularfire2/auth';
import { AngularFirestore, AngularFirestoreModule } from 'angularfire2/firestore';
import { environment } from '../../../environments/environment';
import { FirebaseAuthService } from '../../services/auth/firebase-auth/firebase-auth.service';
import { LoginPageComponent } from './login-page.component';
import { ModalModule } from 'angular-bootstrap-md/modals/modal.module';
import { ModalDirective } from 'angular-bootstrap-md/modals/modal.directive';
describe('LoginPageComponent', () => {
let component: LoginPageComponent;
let fixture: ComponentFixture<LoginPageComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule,
AngularFireModule.initializeApp(environment.firebase),
MDBBootstrapModule.forRoot()
],
providers: [
FirebaseAuthService,
AngularFireAuth,
{ provide: AngularFirestore, depends: AngularFirestoreModule }
],
declarations: [LoginPageComponent],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LoginPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
from mdb-angular-ui-kit.
You can check my repository here: https://github.com/danielsogl/dhbw-projekt-2017
from mdb-angular-ui-kit.
Related Issues (20)
- ERROR in Illegal State: referring to a type without a variable "name":"WavesDirective","members":[]} HOT 1
- mdbInput in mdbModal not getting cleared on this.demoBasic.hide(); HOT 3
- Angular 13 support HOT 3
- Hamburger animation doc not available for angular in mdb bootstrap 4 HOT 2
- Dropdown menu can't be navigated with arrow key HOT 2
- Cannot upgrade to Angular v14 due to package dependency on @angular/cdk v13 HOT 8
- Not working fade animation in tabs HOT 2
- Multilevel dropdown doc not available for MDBA4 HOT 1
- Accordion - Incorrect triggering of Events: itemShown, itemHidden HOT 2
- Dont work to Angular 15 HOT 5
- angular-bootstrap-md + Angular 15 HOT 3
- _option.scss variables HOT 2
- Bug with the class "modal-dialog-scrollable" HOT 2
- Bug with sidenav and slim HOT 2
- Angular 16 Support Release Date? HOT 3
- [Bug] Dropdown position bugged since 5.0.0 HOT 4
- Compatible Angular 17 HOT 4
- Angular 16 Support Migrating from angular-bootstrap-md HOT 1
- Bootstrap version and :root parameters
- ERROR TypeError: can't access property "menuPositionClassChanged", this._dropdownMenu is undefined
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mdb-angular-ui-kit.