Skip to content

Commit 1d46568

Browse files
committed
test: add test for needClientEntry and needHotEntry
1 parent 854ab1b commit 1d46568

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

test/server/clientOptions-option.test.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,46 @@ describe('client option', () => {
6969
req.get(path).expect(200, done);
7070
});
7171
});
72+
73+
describe('configure client entry', () => {
74+
it('disables client entry', (done) => {
75+
server = testServer.start(
76+
config,
77+
{
78+
client: {
79+
needClientEntry: false,
80+
},
81+
port,
82+
},
83+
() => {
84+
request(server.app)
85+
.get('/main.js')
86+
.then((res) => {
87+
expect(res.text).not.toMatch(/client\/index\.js/);
88+
})
89+
.then(done, done);
90+
}
91+
);
92+
});
93+
94+
it('disables hot entry', (done) => {
95+
server = testServer.start(
96+
config,
97+
{
98+
client: {
99+
needHotEntry: false,
100+
},
101+
port,
102+
},
103+
() => {
104+
request(server.app)
105+
.get('/main.js')
106+
.then((res) => {
107+
expect(res.text).not.toMatch(/webpack\/hot\/dev-server\.js/);
108+
})
109+
.then(done, done);
110+
}
111+
);
112+
});
113+
});
72114
});

0 commit comments

Comments
 (0)