File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
projects/elements-demo/src/app/features Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change
1
+ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core' ;
1
2
import { async , ComponentFixture , TestBed } from '@angular/core/testing' ;
3
+ import { HighlightModule } from 'ngx-highlightjs' ;
4
+ import typescript from 'highlight.js/lib/languages/typescript' ;
2
5
3
6
import { SharedModule } from '../../../shared/shared.module' ;
4
7
5
8
import { BasicComponent } from './basic.component' ;
6
- import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core' ;
7
9
8
10
describe ( 'BasicComponent' , ( ) => {
9
11
let component : BasicComponent ;
@@ -12,7 +14,12 @@ describe('BasicComponent', () => {
12
14
beforeEach ( async ( ( ) => {
13
15
TestBed . configureTestingModule ( {
14
16
schemas : [ CUSTOM_ELEMENTS_SCHEMA ] ,
15
- imports : [ SharedModule ] ,
17
+ imports : [
18
+ HighlightModule . forRoot ( {
19
+ languages : ( ) => [ { name : 'typescript' , func : typescript } ]
20
+ } ) ,
21
+ SharedModule
22
+ ] ,
16
23
declarations : [ BasicComponent ]
17
24
} ) . compileComponents ( ) ;
18
25
} ) ) ;
Original file line number Diff line number Diff line change 1
1
import { async , ComponentFixture , TestBed } from '@angular/core/testing' ;
2
2
import { HttpClientTestingModule } from '@angular/common/http/testing' ;
3
+ import { HighlightModule } from 'ngx-highlightjs' ;
4
+ import typescript from 'highlight.js/lib/languages/typescript' ;
3
5
4
6
import { SharedModule } from '../../../shared/shared.module' ;
5
7
@@ -11,7 +13,13 @@ describe('HomeComponent', () => {
11
13
12
14
beforeEach ( async ( ( ) => {
13
15
TestBed . configureTestingModule ( {
14
- imports : [ HttpClientTestingModule , SharedModule ] ,
16
+ imports : [
17
+ HighlightModule . forRoot ( {
18
+ languages : ( ) => [ { name : 'typescript' , func : typescript } ]
19
+ } ) ,
20
+ HttpClientTestingModule ,
21
+ SharedModule
22
+ ] ,
15
23
declarations : [ HomeComponent ]
16
24
} ) . compileComponents ( ) ;
17
25
} ) ) ;
You can’t perform that action at this time.
0 commit comments