Skip to content

Commit 7198897

Browse files
authored
test: add more case for bonjour option (#3208)
1 parent 9e2164e commit 7198897

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

test/server/bonjour-option.test.js

+33
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,37 @@ describe('bonjour option', () => {
112112
expect(mockUnpublishAll).toHaveBeenCalledTimes(0);
113113
});
114114
});
115+
116+
describe('bonjour object and https', () => {
117+
beforeEach((done) => {
118+
server = testServer.start(
119+
config,
120+
{
121+
bonjour: {
122+
type: 'http',
123+
protocol: 'udp',
124+
},
125+
https: true,
126+
port,
127+
},
128+
done
129+
);
130+
});
131+
132+
afterEach((done) => {
133+
server.close(done);
134+
});
135+
136+
it('prefers bonjour options over devServer.https', () => {
137+
expect(mockPublish).toHaveBeenCalledTimes(1);
138+
expect(mockPublish).toHaveBeenCalledWith({
139+
name: `Webpack Dev Server ${os.hostname()}:${port}`,
140+
port,
141+
type: 'http',
142+
protocol: 'udp',
143+
subtypes: ['webpack'],
144+
});
145+
expect(mockUnpublishAll).toHaveBeenCalledTimes(0);
146+
});
147+
});
115148
});

0 commit comments

Comments
 (0)