-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f6d526
commit c6866ce
Showing
324 changed files
with
9,041 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...use-the-default-3a66b-hen-invalidate-is-called-without-any-callback-3-chromium-darwin.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
1 change: 1 addition & 0 deletions
1
...use-the-default-b6f0f-hen-invalidate-is-called-without-any-callback-2-chromium-darwin.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
["[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.","[HMR] Waiting for update signal from WDS...","Hey."] |
1 change: 1 addition & 0 deletions
1
...use-the-default-bfccc-hen-invalidate-is-called-without-any-callback-1-chromium-darwin.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
200 |
1 change: 1 addition & 0 deletions
1
...s/API-Invalidate-callback-should-use-the-provided-callback-function-1-chromium-darwin.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
200 |
1 change: 1 addition & 0 deletions
1
...s/API-Invalidate-callback-should-use-the-provided-callback-function-2-chromium-darwin.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
1 change: 1 addition & 0 deletions
1
...s/API-Invalidate-callback-should-use-the-provided-callback-function-3-chromium-darwin.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
1 change: 1 addition & 0 deletions
1
...ould-allow-URLs-w-67d62-en-the-option-client-webSocketURL-is-object-4-chromium-darwin.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
1 change: 1 addition & 0 deletions
1
...ould-allow-URLs-w-7ad0a-en-the-option-client-webSocketURL-is-object-3-chromium-darwin.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
["[webp |
1 change: 1 addition & 0 deletions
1
...ould-allow-URLs-w-98f38-en-the-option-client-webSocketURL-is-object-1-chromium-darwin.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"ws://test.host:8158/ws" |
1 change: 1 addition & 0 deletions
1
...ould-allow-URLs-w-c54b8-en-the-option-client-webSocketURL-is-object-2-chromium-darwin.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
200 |
1 change: 1 addition & 0 deletions
1
...ots/API-latest-async-API-should-work-when-using-configured-manually-1-chromium-darwin.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
1 change: 1 addition & 0 deletions
1
...d.test.js-snapshots/API-latest-async-API-should-work-with-async-API-1-chromium-darwin.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
["[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.","[HMR] Waiting for update signal from WDS...","Hey."] |
1 change: 1 addition & 0 deletions
1
...d.test.js-snapshots/API-latest-async-API-should-work-with-async-API-2-chromium-darwin.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
1 change: 1 addition & 0 deletions
1
...est.js-snapshots/API-latest-async-API-should-work-with-callback-API-1-chromium-darwin.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
["[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.","[HMR] Waiting for update signal from WDS...","Hey."] |
1 change: 1 addition & 0 deletions
1
...est.js-snapshots/API-latest-async-API-should-work-with-callback-API-2-chromium-darwin.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
1 change: 1 addition & 0 deletions
1
test/e2e-playwright/api-refactored.test.js-snapshots/console-messages-chromium-darwin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
["[HMR] Waiting for update signal from WDS...","[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading disabled, Progress disabled, Overlay disabled.","Hey."] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,318 @@ | ||
"use strict"; | ||
|
||
const os = require("os"); | ||
const webpack = require("webpack"); | ||
const { test } = require("@playwright/test"); | ||
const { expect } = require("@playwright/test"); | ||
const { describe } = require("@playwright/test"); | ||
const { beforeEach, afterEach } = require("@playwright/test"); | ||
// const { jest } = require("@jest/globals"); | ||
const jestMock = require("jest-mock"); | ||
const Server = require("../../lib/Server"); | ||
const config = require("../fixtures/simple-config/webpack.config"); | ||
const port = require("../ports-map").bonjour; | ||
|
||
describe("bonjour option", () => { | ||
let mockPublish; | ||
let mockUnpublishAll; | ||
let mockDestroy; | ||
|
||
beforeEach(() => { | ||
mockPublish = jestMock.fn(); | ||
mockUnpublishAll = jestMock.fn((callback) => { | ||
callback(); | ||
}); | ||
mockDestroy = jestMock.fn(); | ||
}); | ||
|
||
describe("as true", () => { | ||
let compiler; | ||
let server; | ||
let pageErrors; | ||
let consoleMessages; | ||
|
||
beforeEach(async () => { | ||
jest.mock("bonjour-service", () => { | ||
return { | ||
Bonjour: jestMock.fn().mockImplementation(() => { | ||
return { | ||
publish: mockPublish, | ||
unpublishAll: mockUnpublishAll, | ||
destroy: mockDestroy, | ||
}; | ||
}), | ||
}; | ||
}); | ||
|
||
compiler = webpack(config); | ||
|
||
server = new Server({ port, bonjour: true }, compiler); | ||
|
||
await server.start(); | ||
|
||
pageErrors = []; | ||
consoleMessages = []; | ||
}); | ||
|
||
afterEach(async () => { | ||
await server.stop(); | ||
|
||
mockPublish.mockReset(); | ||
mockUnpublishAll.mockReset(); | ||
mockDestroy.mockReset(); | ||
}); | ||
|
||
test("should call bonjour with correct params", async ({ page }) => { | ||
page | ||
.on("console", (message) => { | ||
consoleMessages.push(message); | ||
}) | ||
.on("pageerror", (error) => { | ||
pageErrors.push(error); | ||
}); | ||
|
||
const response = await page.goto(`http://127.0.0.1:${port}/`, { | ||
waitUntil: "networkidle0", | ||
}); | ||
|
||
expect(mockPublish).toHaveBeenCalledTimes(1); | ||
|
||
expect(mockPublish).toHaveBeenCalledWith({ | ||
name: `Webpack Dev Server ${os.hostname()}:${port}`, | ||
port, | ||
type: "http", | ||
subtypes: ["webpack"], | ||
}); | ||
|
||
expect(mockUnpublishAll).toHaveBeenCalledTimes(0); | ||
expect(mockDestroy).toHaveBeenCalledTimes(0); | ||
|
||
expect(JSON.stringify(response.status())).toMatchSnapshot(); | ||
|
||
expect(JSON.stringify(consoleMessages.map((message) => message.text()))).toMatchSnapshot(); | ||
|
||
expect(JSON.stringify(pageErrors)).toMatchSnapshot(); | ||
}); | ||
}); | ||
|
||
describe("with 'server' option", () => { | ||
let compiler; | ||
let server; | ||
let pageErrors; | ||
let consoleMessages; | ||
|
||
beforeEach(async () => { | ||
jestMock.mock("bonjour-service", () => { | ||
return { | ||
Bonjour: jestMock.fn().mockImplementation(() => { | ||
return { | ||
publish: mockPublish, | ||
unpublishAll: mockUnpublishAll, | ||
destroy: mockDestroy, | ||
}; | ||
}), | ||
}; | ||
}); | ||
|
||
compiler = webpack(config); | ||
|
||
server = new Server({ bonjour: true, port, server: "https" }, compiler); | ||
|
||
await server.start(); | ||
|
||
pageErrors = []; | ||
consoleMessages = []; | ||
}); | ||
|
||
afterEach(async () => { | ||
await server.stop(); | ||
}); | ||
|
||
test("should call bonjour with 'https' type", async ({ page }) => { | ||
page | ||
.on("console", (message) => { | ||
consoleMessages.push(message); | ||
}) | ||
.on("pageerror", (error) => { | ||
pageErrors.push(error); | ||
}); | ||
|
||
const response = await page.goto(`https://127.0.0.1:${port}/`, { | ||
waitUntil: "networkidle0", | ||
}); | ||
|
||
expect(mockPublish).toHaveBeenCalledTimes(1); | ||
|
||
expect(mockPublish).toHaveBeenCalledWith({ | ||
name: `Webpack Dev Server ${os.hostname()}:${port}`, | ||
port, | ||
type: "https", | ||
subtypes: ["webpack"], | ||
}); | ||
|
||
expect(mockUnpublishAll).toHaveBeenCalledTimes(0); | ||
expect(mockDestroy).toHaveBeenCalledTimes(0); | ||
|
||
expect(JSON.stringify(response.status())).toMatchSnapshot(); | ||
|
||
expect(JSON.stringify(consoleMessages.map((message) => message.text()))).toMatchSnapshot(); | ||
|
||
expect(JSON.stringify(pageErrors)).toMatchSnapshot(); | ||
}); | ||
}); | ||
|
||
describe("as object", () => { | ||
let compiler; | ||
let server; | ||
let pageErrors; | ||
let consoleMessages; | ||
|
||
beforeEach(async () => { | ||
jest.mock("bonjour-service", () => { | ||
return { | ||
Bonjour: jestMock.fn().mockImplementation(() => { | ||
return { | ||
publish: mockPublish, | ||
unpublishAll: mockUnpublishAll, | ||
destroy: mockDestroy, | ||
}; | ||
}), | ||
}; | ||
}); | ||
|
||
compiler = webpack(config); | ||
|
||
server = new Server( | ||
{ | ||
port, | ||
bonjour: { | ||
type: "https", | ||
protocol: "udp", | ||
}, | ||
}, | ||
compiler, | ||
); | ||
|
||
await server.start(); | ||
|
||
pageErrors = []; | ||
consoleMessages = []; | ||
}); | ||
|
||
afterEach(async () => { | ||
await server.stop(); | ||
}); | ||
|
||
test("should apply bonjour options", async ({ page }) => { | ||
page | ||
.on("console", (message) => { | ||
consoleMessages.push(message); | ||
}) | ||
.on("pageerror", (error) => { | ||
pageErrors.push(error); | ||
}); | ||
|
||
const response = await page.goto(`http://127.0.0.1:${port}/`, { | ||
waitUntil: "networkidle0", | ||
}); | ||
|
||
expect(mockPublish).toHaveBeenCalledTimes(1); | ||
|
||
expect(mockPublish).toHaveBeenCalledWith({ | ||
name: `Webpack Dev Server ${os.hostname()}:${port}`, | ||
port, | ||
type: "https", | ||
protocol: "udp", | ||
subtypes: ["webpack"], | ||
}); | ||
|
||
expect(mockUnpublishAll).toHaveBeenCalledTimes(0); | ||
expect(mockDestroy).toHaveBeenCalledTimes(0); | ||
|
||
expect(JSON.stringify(response.status())).toMatchSnapshot(); | ||
|
||
expect(JSON.stringify(consoleMessages.map((message) => message.text()))).toMatchSnapshot(); | ||
|
||
expect(JSON.stringify(pageErrors)).toMatchSnapshot(); | ||
}); | ||
}); | ||
|
||
describe("bonjour object and 'server' option", () => { | ||
let compiler; | ||
let server; | ||
let pageErrors; | ||
let consoleMessages; | ||
|
||
beforeEach(async () => { | ||
jest.mock("bonjour-service", () => { | ||
return { | ||
Bonjour: jestMock.fn().mockImplementation(() => { | ||
return { | ||
publish: mockPublish, | ||
unpublishAll: mockUnpublishAll, | ||
destroy: mockDestroy, | ||
}; | ||
}), | ||
}; | ||
}); | ||
|
||
compiler = webpack(config); | ||
|
||
server = new Server( | ||
{ | ||
port, | ||
bonjour: { | ||
type: "http", | ||
protocol: "udp", | ||
}, | ||
server: { | ||
type: "https", | ||
}, | ||
}, | ||
compiler, | ||
); | ||
|
||
await server.start(); | ||
|
||
pageErrors = []; | ||
consoleMessages = []; | ||
}); | ||
|
||
afterEach(async () => { | ||
await server.stop(); | ||
}); | ||
|
||
test("should apply bonjour options", async ({ page }) => { | ||
page | ||
.on("console", (message) => { | ||
consoleMessages.push(message); | ||
}) | ||
.on("pageerror", (error) => { | ||
pageErrors.push(error); | ||
}); | ||
|
||
const response = await page.goto(`https://127.0.0.1:${port}/`, { | ||
waitUntil: "networkidle0", | ||
}); | ||
|
||
expect(mockPublish).toHaveBeenCalledTimes(1); | ||
|
||
expect(mockPublish).toHaveBeenCalledWith({ | ||
name: `Webpack Dev Server ${os.hostname()}:${port}`, | ||
port, | ||
type: "http", | ||
protocol: "udp", | ||
subtypes: ["webpack"], | ||
}); | ||
|
||
expect(mockUnpublishAll).toHaveBeenCalledTimes(0); | ||
expect(mockDestroy).toHaveBeenCalledTimes(0); | ||
|
||
expect(JSON.stringify(response.status())).toMatchSnapshot(); | ||
|
||
expect(JSON.stringify(consoleMessages.map((message) => message.text()))).toMatchSnapshot(); | ||
|
||
expect(JSON.stringify(pageErrors)).toMatchSnapshot(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.