Skip to content

Commit d4e9e3a

Browse files
committed
feat: add --web-socket-server
1 parent fc9028c commit d4e9e3a

File tree

5 files changed

+35
-0
lines changed

5 files changed

+35
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ Options:
128128
--firewall [value...] Enable firewall or set hosts that are allowed to access the dev server.
129129
--no-firewall Disable firewall.
130130
--watch-files <value...> Watch static files for file changes.
131+
--web-socket-server <value> Allows to set web socket server.
131132
132133
Global options:
133134
--color Enable colors on console.

bin/cli-flags.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,5 +431,19 @@ module.exports = {
431431
description: 'Watch static files for file changes.',
432432
multiple: true,
433433
},
434+
{
435+
name: 'web-socket-server',
436+
type: String,
437+
configs: [
438+
{
439+
type: 'string',
440+
},
441+
{
442+
type: 'enum',
443+
values: ['sockjs', 'ws'],
444+
},
445+
],
446+
description: 'Allows to set web socket server.',
447+
},
434448
],
435449
};

test/cli/__snapshots__/cli.test.js.snap.webpack4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ Options:
269269
allowed to access the dev server.
270270
--no-firewall Disable firewall.
271271
--watch-files <value...> Watch static files for file changes.
272+
--web-socket-server <value> Allows to set web socket server.
272273

273274
Global options:
274275
--color Enable colors on console.

test/cli/__snapshots__/cli.test.js.snap.webpack5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ Options:
270270
allowed to access the dev server.
271271
--no-firewall Disable firewall.
272272
--watch-files <value...> Watch static files for file changes.
273+
--web-socket-server <value> Allows to set web socket server.
273274

274275
Global options:
275276
--color Enable colors on console.

test/cli/cli.test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,24 @@ describe('CLI', () => {
629629
.catch(done);
630630
});
631631

632+
it('--web-socket-server sockjs', (done) => {
633+
testBin('--web-socket-server sockjs')
634+
.then((output) => {
635+
expect(output.exitCode).toEqual(0);
636+
done();
637+
})
638+
.catch(done);
639+
});
640+
641+
it('--web-socket-server ws', (done) => {
642+
testBin('--web-socket-server ws')
643+
.then((output) => {
644+
expect(output.exitCode).toEqual(0);
645+
done();
646+
})
647+
.catch(done);
648+
});
649+
632650
it('should log static', (done) => {
633651
testBin(
634652
'--no-color',

0 commit comments

Comments
 (0)