diff --git a/.travis.yml b/.travis.yml index 322cd46..413c3cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/lib/src/tinymce.spec.ts b/lib/src/tinymce.spec.ts new file mode 100644 index 0000000..675ba33 --- /dev/null +++ b/lib/src/tinymce.spec.ts @@ -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; + 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 { +} diff --git a/src/test.ts b/src/test.ts index cd612ee..38f4cf6 100644 --- a/src/test.ts +++ b/src/test.ts @@ -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. diff --git a/src/tsconfig.spec.json b/src/tsconfig.spec.json index 63d89ff..c580349 100644 --- a/src/tsconfig.spec.json +++ b/src/tsconfig.spec.json @@ -14,7 +14,7 @@ "test.ts" ], "include": [ - "**/*.spec.ts", + "../lib/**/*.spec.ts", "**/*.d.ts" ] }