Skip to content

Commit

Permalink
test: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Mar 8, 2021
1 parent 81ed2dc commit cd58e70
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/cli/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ describe('CLI', () => {
.catch(done);
});

it('--no-https', (done) => {
testBin('--no-https')
.then((output) => {
expect(output.exitCode).toEqual(0);
expect(/https:\/\//.test(output.stderr)).toEqual(false);
expect(/http:\/\/localhost:[0-9]+/.test(output.stderr)).toEqual(true);
done();
})
.catch(done);
});

it('--history-api-fallback', (done) => {
testBin('--history-api-fallback --no-color')
.then((output) => {
Expand All @@ -67,6 +78,18 @@ describe('CLI', () => {
.catch(done);
});

it('--no-history-api-fallback', (done) => {
testBin('--no-history-api-fallback')
.then((output) => {
expect(output.exitCode).toEqual(0);
expect(output.stderr).not.toContain(
`404s will fallback to '/index.html'`
);
done();
})
.catch(done);
});

it('unspecified host and port', (done) => {
testBin('')
.then((output) => {
Expand Down

0 comments on commit cd58e70

Please sign in to comment.