Skip to content

Commit 123ba09

Browse files
committed
fix(demo): test imports
1 parent abe3493 commit 123ba09

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

projects/elements-demo/src/app/features/examples/basic/basic.component.spec.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
12
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3+
import { HighlightModule } from 'ngx-highlightjs';
4+
import typescript from 'highlight.js/lib/languages/typescript';
25

36
import { SharedModule } from '../../../shared/shared.module';
47

58
import { BasicComponent } from './basic.component';
6-
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
79

810
describe('BasicComponent', () => {
911
let component: BasicComponent;
@@ -12,7 +14,12 @@ describe('BasicComponent', () => {
1214
beforeEach(async(() => {
1315
TestBed.configureTestingModule({
1416
schemas: [CUSTOM_ELEMENTS_SCHEMA],
15-
imports: [SharedModule],
17+
imports: [
18+
HighlightModule.forRoot({
19+
languages: () => [{ name: 'typescript', func: typescript }]
20+
}),
21+
SharedModule
22+
],
1623
declarations: [BasicComponent]
1724
}).compileComponents();
1825
}));

projects/elements-demo/src/app/features/home/home/home.component.spec.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
22
import { HttpClientTestingModule } from '@angular/common/http/testing';
3+
import { HighlightModule } from 'ngx-highlightjs';
4+
import typescript from 'highlight.js/lib/languages/typescript';
35

46
import { SharedModule } from '../../../shared/shared.module';
57

@@ -11,7 +13,13 @@ describe('HomeComponent', () => {
1113

1214
beforeEach(async(() => {
1315
TestBed.configureTestingModule({
14-
imports: [HttpClientTestingModule, SharedModule],
16+
imports: [
17+
HighlightModule.forRoot({
18+
languages: () => [{ name: 'typescript', func: typescript }]
19+
}),
20+
HttpClientTestingModule,
21+
SharedModule
22+
],
1523
declarations: [HomeComponent]
1624
}).compileComponents();
1725
}));

0 commit comments

Comments
 (0)