Skip to content

Commit

Permalink
fix travis
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Jan 5, 2018
1 parent 82d5142 commit 2adbf20
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 4 deletions.
20 changes: 18 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
sudo: false
language: node_js
node_js:
- "6"
- "8.5.0"

addons:
chrome: stable

git:
depth: 1

before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

install:
- npm install

script:
- npm run pretest
- npm run test
- npm run test-coverage
37 changes: 37 additions & 0 deletions lib/src/tinymce.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { NgxTinymceModule } from '../index';

const html = ``;

describe('Component: ngx-tinymce', () => {
let fixture: ComponentFixture<any>;
let context: TestComponent;
let element: any;
let clean: any;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [TestComponent],
imports: [NgxTinymceModule]
});
TestBed.overrideComponent(TestComponent, {set: {template: html}});
fixture = TestBed.createComponent(TestComponent);
context = fixture.componentInstance;
element = fixture.nativeElement.querySelector('#c1');
clean = fixture.nativeElement.querySelector('#c2');
fixture.detectChanges();
});

it('fixture should not be null', () => {
expect(fixture).not.toBeNull();
});
});

@Component({
selector: 'app-tinymce-test',
template: ''
})
class TestComponent {
}
2 changes: 1 addition & 1 deletion src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ getTestBed().initTestEnvironment(
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
const context = require.context('../lib/', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
// Finally, start Karma to run the tests.
Expand Down
2 changes: 1 addition & 1 deletion src/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test.ts"
],
"include": [
"**/*.spec.ts",
"../lib/**/*.spec.ts",
"**/*.d.ts"
]
}

0 comments on commit 2adbf20

Please sign in to comment.