Skip to content

Commit

Permalink
test: move tests to contentBase
Browse files Browse the repository at this point in the history
  • Loading branch information
EslamHiko committed Jun 26, 2019
1 parent 668cd3f commit 6fccea4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 91 deletions.
91 changes: 0 additions & 91 deletions test/ExternalPathsWatch.test.js

This file was deleted.

38 changes: 38 additions & 0 deletions test/server/contentBase-option.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,44 @@ describe('contentBase option', () => {
});
});

describe('testing single & multiple external paths', () => {
afterAll((done) => {
testServer.close(() => {
done();
});
});
it('Should throw exception (string)', (done) => {
try {
// eslint-disable-next-line no-unused-vars
server = testServer.start(config, {
port: 9004,
contentBase: 'https://example.com/',
watchContentBase: true,
});

expect(true).toBe(false);
} catch (e) {
expect(e.message).toBe('Watching remote files is not supported.');
done();
}
});
it('Should throw exception (array)', (done) => {
try {
// eslint-disable-next-line no-unused-vars
server = testServer.start(config, {
port: 9003,
contentBase: [contentBasePublic, 'https://example.com/'],
watchContentBase: true,
});

expect(true).toBe(false);
} catch (e) {
expect(e.message).toBe('Watching remote files is not supported.');
done();
}
});
});

describe('default to PWD', () => {
beforeAll((done) => {
jest.spyOn(process, 'cwd').mockImplementation(() => contentBasePublic);
Expand Down

0 comments on commit 6fccea4

Please sign in to comment.