Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKamaev committed Oct 19, 2018
1 parent f7d82ba commit 8c68e4e
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/server/compiler-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('Compiler', function () {
describe('ES-next', function () {
it('Should compile test defined in separate module if option is enabled', function () {
const sources = [
'test/server/data/test-suites/test-as-module/testfile.js'
'test/server/data/test-suites/test-as-module/with-tests/testfile.js'
];

return compile(sources, true)
Expand All @@ -67,7 +67,7 @@ describe('Compiler', function () {

it('Should not compile test defined in separate module if option is disabled', function () {
const sources = [
'test/server/data/test-suites/test-as-module/testfile.js'
'test/server/data/test-suites/test-as-module/with-tests/testfile.js'
];

return compile(sources)
Expand Down Expand Up @@ -175,7 +175,7 @@ describe('Compiler', function () {
describe('TypeScript', function () {
it('Should compile test defined in separate module if option is enabled', function () {
const sources = [
'test/server/data/test-suites/test-as-module/testfile.ts'
'test/server/data/test-suites/test-as-module/with-tests/testfile.ts'
];

return compile(sources, true)
Expand All @@ -193,7 +193,7 @@ describe('Compiler', function () {

it('Should not compile test defined in separate module if option is disabled', function () {
const sources = [
'test/server/data/test-suites/test-as-module/testfile.ts'
'test/server/data/test-suites/test-as-module/with-tests/testfile.ts'
];

return compile(sources)
Expand Down Expand Up @@ -316,7 +316,7 @@ describe('Compiler', function () {
describe('CoffeeScript', function () {
it('Should compile test defined in separate module if option is enabled', function () {
const sources = [
'test/server/data/test-suites/test-as-module/testfile.coffee'
'test/server/data/test-suites/test-as-module/with-tests/testfile.coffee'
];

return compile(sources, true)
Expand All @@ -334,7 +334,7 @@ describe('Compiler', function () {

it('Should not compile test defined in separate module if option is disabled', function () {
const sources = [
'test/server/data/test-suites/test-as-module/testfile.coffee'
'test/server/data/test-suites/test-as-module/with-tests/testfile.coffee'
];

return compile(sources)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export default function libraryTests () {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import libraryTest from './lib';

libraryTest();
10 changes: 10 additions & 0 deletions test/server/runner-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,16 @@ describe('Runner', () => {
expect(err.message).eql('No test file specified.');
});
});

it('Should raise an error if the source and imported midule have no tests', () => {
return runner
.browsers(connection)
.src(['test/server/data/test-suites/test-as-module/without-tests/testfile.js'])
.run()
.catch(err => {
expect(err.message).eql('No tests to run. Either the test files contain no tests or the filter function is too restrictive.');
});
});
});

describe('.filter()', () => {
Expand Down

0 comments on commit 8c68e4e

Please sign in to comment.