Skip to content

Commit

Permalink
fix bug with run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ярослав Кикоть authored and Ярослав Кикоть committed Sep 1, 2018
1 parent c222428 commit b19b1fa
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 16 deletions.
15 changes: 8 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@

dist: trusty
sudo: false

language: node_js
node_js:
- "8"

sudo: required
addons:
chrome: stable # have Travis install Chrome stable.
install:
- npm install
script:
- npm run test
cache:
directories:
- ./node_modules

install:
- npm install
- node_modules
2 changes: 1 addition & 1 deletion projects/ngx-tree-dnd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ You need to import default styles for tree ( you can change them by rewrite clas
"prefix": "app",
"styles": [
"styles.css",
"../node_modules/ngx-tree-dnd/styles-tree-dnd.css"
"../node_modules/ngx-tree-dnd/lib/styles-tree-dnd.css"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
Expand Down
13 changes: 8 additions & 5 deletions projects/ngx-tree-dnd/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ module.exports = function (config) {
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
mime: {
"text/x-typescript": ["ts", "tsx"],
},
reporters: ['progress', 'kjhtml'],
port: 9876,
port: 9876, // karma web server port
colors: true,
logLevel: config.LOG_INFO,
browsers: ['PhantomJS'],
autoWatch: true,
browsers: [
'PhantomJS'
],
singleRun: false
singleRun: true, // Karma captures browsers, runs the tests and exits
concurrency: Infinity,
failOnEmptyTestSuite: true
});
};
13 changes: 13 additions & 0 deletions projects/ngx-tree-dnd/src/lib/ngx-tree-dnd.module.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { NgxTreeDndModule } from './ngx-tree-dnd.module';

describe('NgxTreeDndModule', () => {
let ngxTreeDndModule: NgxTreeDndModule;

beforeEach(() => {
ngxTreeDndModule = new NgxTreeDndModule();
});

it('should create an instance', () => {
expect(ngxTreeDndModule).toBeTruthy();
});
});
13 changes: 13 additions & 0 deletions src/app/test/test.module.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { TestModule } from './test.module';

describe('TestModule', () => {
let testModule: TestModule;

beforeEach(() => {
testModule = new TestModule();
});

it('should create an instance', () => {
expect(testModule).toBeTruthy();
});
});
10 changes: 10 additions & 0 deletions src/app/test/test.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

@NgModule({
imports: [
CommonModule
],
declarations: []
})
export class TestModule { }
7 changes: 5 additions & 2 deletions src/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = function (config) {
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-phantomjs-launcher'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
Expand All @@ -27,7 +27,10 @@ module.exports = function (config) {
autoWatch: true,
captureTimeout: 25000,
browserNoActivityTimeout: 50000,
browsers: ['phantomJS'],
browsers: [
'ChromeHeadless'
],
mime: { 'text/x-typescript': ['ts','tsx'] },
singleRun: false
});
};
2 changes: 1 addition & 1 deletion src/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"types": []
},
"exclude": [
"src/test.ts",
"test.ts",
"**/*.spec.ts"
]
}

0 comments on commit b19b1fa

Please sign in to comment.