Commit 6fbb260d authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

WIP: tests integration with CI

parent aacafe0b
......@@ -29,6 +29,7 @@ out-tsc
/e2e/*.js
/e2e/*.map
/typings
/coverage
#--- OTHER ---#
......
# UID := $(id -u)
# GID := $(id -g)
UID := $(id -u)
GID := $(id -g)
UID := 1000
GID := 1000
# UID := 1000
# GID := 1000
list:
@echo ""
......@@ -39,11 +39,12 @@ stop:
restart: stop start
test:
rm -rf ./coverage
@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
--name anis-client \
-p 9876:9876 \
-v $(CURDIR):/project -d \
-w /project anis-node ng test
-w /project anis-node ng test --code-coverage
ng-build:
@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
......
......@@ -86,6 +86,7 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"codeCoverage": true,
"assets": [
"src/favicon.ico",
"src/assets"
......
......@@ -8,7 +8,6 @@ module.exports = function (config) {
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-firefox-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
......@@ -17,7 +16,7 @@ module.exports = function (config) {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
// dir: require('path').join(__dirname, './coverage/anis-client'),
dir: require('path').join(__dirname, './coverage'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
......@@ -26,8 +25,14 @@ module.exports = function (config) {
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Firefox'],
singleRun: false,
browsers: ['ChromeHeadlessCI'],
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
}
},
singleRun: true,
restartOnFileChange: true
});
};
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HomeComponent } from './home.component';
describe('HomeComponent', () => {
let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HomeComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(HomeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment