Skip to content

Commit 990562a

Browse files
committed
tests first step
1 parent 48c570e commit 990562a

File tree

4 files changed

+26
-13
lines changed

4 files changed

+26
-13
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
{
22
"name": "ngx-simple-charts",
33
"version": "0.0.3",
4-
"license" : "Apache License Version 2.0",
4+
"license": "Apache License Version 2.0",
55
"scripts": {
66
"ng": "ng",
77
"start": "ng serve",
88
"build": "ng build",
9-
"build-watch": "ng build --watch",
9+
"build-watch": "ng build --watch",
1010
"build-prod": "ng build --configuration=production",
11-
"test": "ng test",
11+
"test": "ng test --browsers ChromeHeadless --watch=false",
12+
"test-chromium": "ng test --browsers ChromiumHeadless --watch=false",
13+
"test-watch-local": "ng test --browsers ChromiumHeadless --watch=true",
1214
"lint": "ng lint"
1315
},
1416
"private": false,

projects/ngx-simple-charts/karma.conf.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = function (config) {
1818
require('karma-jasmine'),
1919
require('karma-chrome-launcher'),
2020
require('karma-jasmine-html-reporter'),
21-
require('karma-coverage'),
21+
require('karma-coverage-istanbul-reporter'),
2222
require('@angular-devkit/build-angular/plugins/karma')
2323
],
2424
client: {
@@ -34,7 +34,7 @@ module.exports = function (config) {
3434
suppressAll: true // removes the duplicated traces
3535
},
3636
coverageReporter: {
37-
dir: require('path').join(__dirname, '../../coverage/ngx-simple-charts'),
37+
dir: require('path').join(__dirname, '../../coverage'),
3838
subdir: '.',
3939
reporters: [
4040
{ type: 'html' },
@@ -46,7 +46,17 @@ module.exports = function (config) {
4646
colors: true,
4747
logLevel: config.LOG_INFO,
4848
autoWatch: true,
49-
browsers: ['Chrome'],
49+
browsers: ['Chromium', 'ChromeHeadless', 'ChromiumHeadless'],
50+
customLaunchers: {
51+
ChromeHeadless: {
52+
base: 'Chrome',
53+
flags: ['--no-sandbox','--headless', '--disable-gpu', '--remote-debugging-port=9222']
54+
},
55+
ChromiumHeadless: {
56+
base: 'Chromium',
57+
flags: ['--no-sandbox','--headless', '--disable-gpu', '--remote-debugging-port=9222']
58+
}
59+
},
5060
singleRun: false,
5161
restartOnFileChange: true
5262
});

projects/ngx-simple-charts/src/lib/sc-line-chart/sc-line-chart.component.spec.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,23 @@
1212
*/
1313
import { ComponentFixture, TestBed } from '@angular/core/testing';
1414

15-
/*import { NgxSimpleChartsComponent } from './ngx-simple-charts.component';
15+
import { ScLineChartComponent } from './sc-line-chart.component';
16+
1617
describe('NgxSimpleChartsComponent', () => {
17-
let component: NgxSimpleChartsComponent;
18-
let fixture: ComponentFixture<NgxSimpleChartsComponent>;
18+
let component: ScLineChartComponent;
19+
let fixture: ComponentFixture<ScLineChartComponent>;
1920
beforeEach(async () => {
2021
await TestBed.configureTestingModule({
21-
declarations: [ NgxSimpleChartsComponent ]
22+
declarations: [ ScLineChartComponent ]
2223
})
2324
.compileComponents();
2425
});
2526
beforeEach(() => {
26-
fixture = TestBed.createComponent(NgxSimpleChartsComponent);
27+
fixture = TestBed.createComponent(ScLineChartComponent);
2728
component = fixture.componentInstance;
2829
fixture.detectChanges();
2930
});
3031
it('should create', () => {
3132
expect(component).toBeTruthy();
3233
});
33-
});*/
34+
});

0 commit comments

Comments
 (0)