Skip to content

Commit a815f05

Browse files
committed
test: add snapshots
1 parent 2c46514 commit a815f05

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

test/e2e/__snapshots__/api.test.js.snap.webpack5

+5-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ Array [
5555

5656
exports[`API should work with callback API: page errors 1`] = `Array []`;
5757

58-
exports[`API should work with deprecated API ('listen' and \`close\` methods): console messages 1`] = `
58+
exports[`API should work with deprecated API ('listen' and 'close' methods): close deprecation log 1`] = `"'close' is deprecated. Please use the async 'stop' or 'stopCallback' method."`;
59+
60+
exports[`API should work with deprecated API ('listen' and 'close' methods): console messages 1`] = `
5961
Array [
6062
"[HMR] Waiting for update signal from WDS...",
6163
"Hey.",
@@ -64,9 +66,9 @@ Array [
6466
]
6567
`;
6668

67-
exports[`API should work with deprecated API ('listen' and \`close\` methods): deprecation log 1`] = `"'listen' is deprecated. Please use async 'start' or 'startCallback' methods."`;
69+
exports[`API should work with deprecated API ('listen' and 'close' methods): listen deprecation log 1`] = `"'listen' is deprecated. Please use the async 'start' or 'startCallback' method."`;
6870

69-
exports[`API should work with deprecated API ('listen' and \`close\` methods): page errors 1`] = `Array []`;
71+
exports[`API should work with deprecated API ('listen' and 'close' methods): page errors 1`] = `Array []`;
7072

7173
exports[`API should work with deprecated API (only compiler in constructor): console messages 1`] = `
7274
Array [

test/e2e/api.test.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ describe("API", () => {
204204
await server.stop();
205205
});
206206

207-
it("should work with deprecated API ('listen' and `close` methods)", async () => {
207+
it("should work with deprecated API ('listen' and 'close' methods)", async () => {
208208
const compiler = webpack(config);
209209
const devServerOptions = { port };
210210
const utilSpy = jest.spyOn(util, "deprecate");
@@ -239,19 +239,24 @@ describe("API", () => {
239239
waitUntil: "networkidle0",
240240
});
241241

242-
expect(utilSpy.mock.calls[0][1]).toMatchSnapshot("deprecation log");
242+
expect(utilSpy.mock.calls[0][1]).toMatchSnapshot("listen deprecation log");
243243
expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(
244244
"console messages"
245245
);
246246
expect(pageErrors).toMatchSnapshot("page errors");
247247

248-
utilSpy.mockRestore();
249248
await browser.close();
250249
await new Promise((resolve) => {
251250
server.close(() => {
252251
resolve();
253252
});
254253
});
254+
255+
expect(
256+
utilSpy.mock.calls[utilSpy.mock.calls.length - 1][1]
257+
).toMatchSnapshot("close deprecation log");
258+
259+
utilSpy.mockRestore();
255260
});
256261

257262
it(`should work with deprecated API (the order of the arguments in the constructor)`, async () => {

0 commit comments

Comments
 (0)