Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6a90c04

Browse files
hallysonhmlrv
authored andcommittedSep 17, 2019
fix: BrowserModule has already been loaded (#31)
1 parent 05fe7ee commit 6a90c04

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed
 

‎.travis.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ language: node_js
22
node_js:
33
- "8.10.0"
44

5+
services:
6+
- xvfb
7+
58
script:
69
- ng lint
710
- ng build --prod
8-
- ng test
11+
- ng test --watch=false
912

1013
before_install:
1114
- export CHROME_BIN=chromium-browser
1215
- export DISPLAY=:99.0
13-
- sh -e /etc/init.d/xvfb start
1416

1517
before_script: npm rebuild node-sass;

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"ng-packagr": "^4.4.0",
5757
"phantomjs-prebuilt": "^2.1.16",
5858
"protractor": "~5.4.0",
59+
"puppeteer": "^1.20.0",
5960
"rxjs": "~6.3.3",
6061
"ts-node": "~7.0.0",
6162
"tsickle": "^0.33.1",

‎src/app/app.module.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { NgModule } from '@angular/core';
2+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
23
import { AppComponent } from './app.component';
34
import { TreetableModule } from './treetable/treetable.module';
45

@@ -7,6 +8,7 @@ import { TreetableModule } from './treetable/treetable.module';
78
AppComponent
89
],
910
imports: [
11+
BrowserAnimationsModule,
1012
TreetableModule
1113
],
1214
providers: [],

‎src/app/treetable/treetable.module.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { CommonModule } from '@angular/common';
12
import { NgModule } from '@angular/core';
2-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
33
import { MatTableModule } from '@angular/material/table';
44
import { MatIconModule } from '@angular/material/icon';
55
import { TreetableComponent } from './component/treetable.component';
@@ -10,7 +10,7 @@ export { Node, Options} from './models';
1010
TreetableComponent
1111
],
1212
imports: [
13-
BrowserAnimationsModule,
13+
CommonModule,
1414
MatTableModule,
1515
MatIconModule
1616
],

‎src/karma.conf.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Karma configuration file, see link for more information
22
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
// Set the CHROME_BIN
4+
process.env.CHROME_BIN = require('puppeteer').executablePath();
35

46
module.exports = function (config) {
57
config.set({
@@ -8,7 +10,6 @@ module.exports = function (config) {
810
plugins: [
911
require('karma-jasmine'),
1012
require('karma-chrome-launcher'),
11-
require('karma-phantomjs-launcher'),
1213
require('karma-jasmine-html-reporter'),
1314
require('karma-coverage-istanbul-reporter'),
1415
require('@angular-devkit/build-angular/plugins/karma')
@@ -26,7 +27,13 @@ module.exports = function (config) {
2627
colors: true,
2728
logLevel: config.LOG_INFO,
2829
autoWatch: true,
29-
browsers: ['Chrome'],
30-
singleRun: true
30+
browsers: ['ChromeHeadlessNoSandbox'],
31+
customLaunchers: {
32+
ChromeHeadlessNoSandbox: {
33+
base: 'ChromeHeadless',
34+
flags: ['--no-sandbox']
35+
}
36+
},
37+
singleRun: false
3138
});
3239
};

0 commit comments

Comments
 (0)
Please sign in to comment.