Skip to content

Commit 35486cc

Browse files
committed
fixed karma config
1 parent 9fe6080 commit 35486cc

File tree

9 files changed

+56
-63
lines changed

9 files changed

+56
-63
lines changed

angular.json

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,9 @@
1818
"main": "src/main.ts",
1919
"polyfills": "src/polyfills.ts",
2020
"tsConfig": "src/tsconfig.app.json",
21-
"assets": [
22-
"src/favicon.ico",
23-
"src/assets"
24-
],
25-
"styles": [
26-
"src/styles.css",
27-
"node_modules/bootstrap/dist/css/bootstrap.min.css",
28-
"node_modules/codemirror/lib/codemirror.css"
29-
],
30-
"scripts": [
31-
"node_modules/codemirror/lib/codemirror.js"
32-
]
21+
"assets": ["src/favicon.ico", "src/assets"],
22+
"styles": ["src/styles.css", "node_modules/bootstrap/dist/css/bootstrap.min.css", "node_modules/codemirror/lib/codemirror.css"],
23+
"scripts": ["node_modules/codemirror/lib/codemirror.js"]
3324
},
3425
"configurations": {
3526
"production": {
@@ -75,26 +66,16 @@
7566
"polyfills": "src/polyfills.ts",
7667
"tsConfig": "src/tsconfig.spec.json",
7768
"karmaConfig": "src/karma.conf.js",
78-
"styles": [
79-
"src/styles.css"
80-
],
81-
"scripts": [],
82-
"assets": [
83-
"src/favicon.ico",
84-
"src/assets"
85-
]
69+
"styles": ["src/styles.css"],
70+
"scripts": ["node_modules/codemirror/lib/codemirror.js"],
71+
"assets": ["src/favicon.ico", "src/assets"]
8672
}
8773
},
8874
"lint": {
8975
"builder": "@angular-devkit/build-angular:tslint",
9076
"options": {
91-
"tsConfig": [
92-
"src/tsconfig.app.json",
93-
"src/tsconfig.spec.json"
94-
],
95-
"exclude": [
96-
"**/node_modules/**"
97-
]
77+
"tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
78+
"exclude": ["**/node_modules/**"]
9879
}
9980
}
10081
}
@@ -119,9 +100,7 @@
119100
"builder": "@angular-devkit/build-angular:tslint",
120101
"options": {
121102
"tsConfig": "e2e/tsconfig.e2e.json",
122-
"exclude": [
123-
"**/node_modules/**"
124-
]
103+
"exclude": ["**/node_modules/**"]
125104
}
126105
}
127106
}
@@ -150,13 +129,8 @@
150129
"lint": {
151130
"builder": "@angular-devkit/build-angular:tslint",
152131
"options": {
153-
"tsConfig": [
154-
"projects/ngx-text-diff/tsconfig.lib.json",
155-
"projects/ngx-text-diff/tsconfig.spec.json"
156-
],
157-
"exclude": [
158-
"**/node_modules/**"
159-
]
132+
"tsConfig": ["projects/ngx-text-diff/tsconfig.lib.json", "projects/ngx-text-diff/tsconfig.spec.json"],
133+
"exclude": ["**/node_modules/**"]
160134
}
161135
}
162136
}

package-lock.json

Lines changed: 17 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"codelyzer": "~4.3.0",
4242
"jasmine-core": "~2.99.1",
4343
"jasmine-spec-reporter": "~4.2.1",
44-
"karma": "~3.0.0",
44+
"karma": "^3.0.0",
4545
"karma-chrome-launcher": "~2.2.0",
4646
"karma-coverage-istanbul-reporter": "~2.0.1",
4747
"karma-jasmine": "~1.1.2",
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
/*import { async, ComponentFixture, TestBed } from '@angular/core/testing';
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
22

33
import { NgxTextDiffComponent } from './ngx-text-diff.component';
4+
import { FormsModule } from '@angular/forms';
5+
import { CommonModule } from '@angular/common';
46

57
describe('NgxTextDiffComponent', () => {
68
let component: NgxTextDiffComponent;
79
let fixture: ComponentFixture<NgxTextDiffComponent>;
810

911
beforeEach(async(() => {
1012
TestBed.configureTestingModule({
11-
declarations: [ NgxTextDiffComponent ]
12-
})
13-
.compileComponents();
13+
imports: [FormsModule, CommonModule],
14+
declarations: [NgxTextDiffComponent]
15+
}).compileComponents();
1416
}));
1517

1618
beforeEach(() => {
@@ -22,4 +24,4 @@ describe('NgxTextDiffComponent', () => {
2224
it('should create', () => {
2325
expect(component).toBeTruthy();
2426
});
25-
});*/
27+
});

projects/ngx-text-diff/src/lib/ngx-text-diff.service.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*import { TestBed } from '@angular/core/testing';
1+
import { TestBed } from '@angular/core/testing';
22

33
import { NgxTextDiffService } from './ngx-text-diff.service';
44

@@ -9,4 +9,4 @@ describe('NgxTextDiffService', () => {
99
const service: NgxTextDiffService = TestBed.get(NgxTextDiffService);
1010
expect(service).toBeTruthy();
1111
});
12-
});*/
12+
});
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
/*
21
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
32

43
import { CodeEditorComponent } from './code-editor.component';
4+
import { CommonModule } from '@angular/common';
55

66
describe('CodeEditorComponent', () => {
77
let component: CodeEditorComponent;
88
let fixture: ComponentFixture<CodeEditorComponent>;
99

1010
beforeEach(async(() => {
1111
TestBed.configureTestingModule({
12-
declarations: [ CodeEditorComponent ]
13-
})
14-
.compileComponents();
12+
imports: [CommonModule],
13+
declarations: [CodeEditorComponent]
14+
}).compileComponents();
1515
}));
1616

1717
beforeEach(() => {
@@ -24,4 +24,3 @@ describe('CodeEditorComponent', () => {
2424
expect(component).toBeTruthy();
2525
});
2626
});
27-
*/

src/app/components/components.module.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*import { ComponentsModule } from './components.module';
1+
import { ComponentsModule } from './components.module';
22

33
describe('ComponentsModule', () => {
44
let componentsModule: ComponentsModule;
@@ -10,4 +10,4 @@ describe('ComponentsModule', () => {
1010
it('should create an instance', () => {
1111
expect(componentsModule).toBeTruthy();
1212
});
13-
});*/
13+
});
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
/*import { async, ComponentFixture, TestBed } from '@angular/core/testing';
1+
/*
2+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
23
34
import { HomeComponent } from './home.component';
5+
import { NgxTextDiffModule } from '../../../projects/ngx-text-diff/src/lib/ngx-text-diff.module';
6+
import { ComponentsModule } from '../components/components.module';
7+
import { CodeEditorComponent } from '../components/code-editor/code-editor.component';
8+
import { CommonModule } from '@angular/common';
49
510
describe('HomeComponent', () => {
611
let component: HomeComponent;
712
let fixture: ComponentFixture<HomeComponent>;
813
914
beforeEach(async(() => {
1015
TestBed.configureTestingModule({
11-
declarations: [ HomeComponent ]
12-
})
13-
.compileComponents();
16+
imports: [NgxTextDiffModule, CommonModule, ComponentsModule, CodeEditorComponent],
17+
declarations: [HomeComponent]
18+
}).compileComponents();
1419
}));
1520
1621
beforeEach(() => {
@@ -22,4 +27,5 @@ describe('HomeComponent', () => {
2227
it('should create', () => {
2328
expect(component).toBeTruthy();
2429
});
25-
});*/
30+
});
31+
*/

src/karma.conf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ module.exports = function (config) {
3333
flags: ['--no-sandbox']
3434
}
3535
},
36+
// you can define custom flags
3637
singleRun: true
3738
});
3839
};

0 commit comments

Comments
 (0)