Skip to content

Commit e07a5d7

Browse files
authored
test: cover more cases for cli tests (#3156)
1 parent 229303d commit e07a5d7

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed

test/cli/cli.test.js

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,56 @@ describe('CLI', () => {
5050
.catch(done);
5151
});
5252

53+
it('--no-bonjour', (done) => {
54+
testBin('--no-bonjour')
55+
.then((output) => {
56+
expect(output.exitCode).toEqual(0);
57+
expect(output.stderr).not.toContain('Bonjour');
58+
done();
59+
})
60+
.catch(done);
61+
});
62+
63+
it('--client-progress', (done) => {
64+
testBin('--client-progress')
65+
.then((output) => {
66+
expect(output.exitCode).toEqual(0);
67+
done();
68+
})
69+
.catch(done);
70+
});
71+
72+
it('--no-client-progress', (done) => {
73+
testBin('--no-client-progress')
74+
.then((output) => {
75+
expect(output.exitCode).toEqual(0);
76+
done();
77+
})
78+
.catch(done);
79+
});
80+
81+
it('--http2', (done) => {
82+
testBin('--http2')
83+
.then((output) => {
84+
expect(output.exitCode).toEqual(0);
85+
expect(output.stderr).toContain('Project is running at');
86+
expect(/https:\/\//.test(output.stderr)).toEqual(true);
87+
done();
88+
})
89+
.catch(done);
90+
});
91+
92+
it('--no-http2', (done) => {
93+
testBin('--no-http2')
94+
.then((output) => {
95+
expect(output.exitCode).toEqual(0);
96+
expect(/https:\/\//.test(output.stderr)).toEqual(false);
97+
expect(/http:\/\/localhost:[0-9]+/.test(output.stderr)).toEqual(true);
98+
done();
99+
})
100+
.catch(done);
101+
});
102+
53103
it('--https', (done) => {
54104
testBin('--https')
55105
.then((output) => {
@@ -319,6 +369,42 @@ describe('CLI', () => {
319369
.catch(done);
320370
});
321371

372+
it('--no-client-overlay', (done) => {
373+
testBin('--no-client-overlay')
374+
.then((output) => {
375+
expect(output.exitCode).toEqual(0);
376+
done();
377+
})
378+
.catch(done);
379+
});
380+
381+
it('--client-logging', (done) => {
382+
testBin('--client-logging verbose')
383+
.then((output) => {
384+
expect(output.exitCode).toEqual(0);
385+
done();
386+
})
387+
.catch(done);
388+
});
389+
390+
it('--compress', (done) => {
391+
testBin('--compress')
392+
.then((output) => {
393+
expect(output.exitCode).toEqual(0);
394+
done();
395+
})
396+
.catch(done);
397+
});
398+
399+
it('--no-compress', (done) => {
400+
testBin('--compress')
401+
.then((output) => {
402+
expect(output.exitCode).toEqual(0);
403+
done();
404+
})
405+
.catch(done);
406+
});
407+
322408
it('should generate correct cli flags', (done) => {
323409
testBin('--help')
324410
.then((output) => {

0 commit comments

Comments
 (0)