Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add e2e tests for built in routes #3669

Merged
merged 2 commits into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions test/e2e/__snapshots__/built-in-routes.test.js.snap.webpack4
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Built in routes with multi config should handle GET request to directory index and list all middleware directories: console messages 1`] = `Array []`;

exports[`Built in routes with multi config should handle GET request to directory index and list all middleware directories: directory list 1`] = `
"<h1>Assets Report:</h1><div><h2>Compilation: unnamed[0]</h2><ul><li>
<strong><a href=\\"/bundle1/foo.js\\" target=\\"_blank\\">foo.js</a></strong>
</li><li>
<strong><a href=\\"/bundle1/path/to/file.html\\" target=\\"_blank\\">path/to/file.html</a></strong>
</li></ul></div><div><h2>Compilation: named</h2><ul><li>
<strong><a href=\\"/bundle2/bar.js\\" target=\\"_blank\\">bar.js</a></strong>
</li></ul></div><div><h2>Compilation: other</h2><ul><li>
<strong><a href=\\"bar.js\\" target=\\"_blank\\">bar.js</a></strong>
</li></ul></div>"
`;

exports[`Built in routes with multi config should handle GET request to directory index and list all middleware directories: page errors 1`] = `Array []`;

exports[`Built in routes with multi config should handle GET request to directory index and list all middleware directories: response headers content-type 1`] = `"text/html"`;

exports[`Built in routes with multi config should handle GET request to directory index and list all middleware directories: response status 1`] = `200`;

exports[`Built in routes with simple config should handle GET request to directory index and list all middleware directories: console messages 1`] = `Array []`;

exports[`Built in routes with simple config should handle GET request to directory index and list all middleware directories: directory list 1`] = `
"<h1>Assets Report:</h1><div><h2>Compilation: unnamed</h2><ul><li>
<strong><a href=\\"main.js\\" target=\\"_blank\\">main.js</a></strong>
</li><li>
<strong><a href=\\"test.html\\" target=\\"_blank\\">test.html</a></strong>
</li></ul></div>"
`;

exports[`Built in routes with simple config should handle GET request to directory index and list all middleware directories: page errors 1`] = `Array []`;

exports[`Built in routes with simple config should handle GET request to directory index and list all middleware directories: response headers content-type 1`] = `"text/html"`;

exports[`Built in routes with simple config should handle GET request to directory index and list all middleware directories: response status 1`] = `200`;

exports[`Built in routes with simple config should handle GET request to invalidate endpoint: console messages 1`] = `Array []`;

exports[`Built in routes with simple config should handle GET request to invalidate endpoint: page errors 1`] = `Array []`;

exports[`Built in routes with simple config should handle GET request to invalidate endpoint: response status 1`] = `200`;

exports[`Built in routes with simple config should handle GET request to magic async chunk: console messages 1`] = `Array []`;

exports[`Built in routes with simple config should handle GET request to magic async chunk: response headers content-type 1`] = `"application/javascript; charset=utf-8"`;

exports[`Built in routes with simple config should handle GET request to magic async chunk: response status 1`] = `200`;

exports[`Built in routes with simple config should handle GET request to magic async html: console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
"[webpack-dev-server] Hot Module Replacement enabled.",
"[webpack-dev-server] Live Reloading enabled.",
]
`;

exports[`Built in routes with simple config should handle GET request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;

exports[`Built in routes with simple config should handle GET request to magic async html: response status 1`] = `200`;

exports[`Built in routes with simple config should handle HEAD request to directory index: console messages 1`] = `Array []`;

exports[`Built in routes with simple config should handle HEAD request to directory index: directory list 1`] = `""`;

exports[`Built in routes with simple config should handle HEAD request to directory index: page errors 1`] = `Array []`;

exports[`Built in routes with simple config should handle HEAD request to directory index: response headers content-type 1`] = `"text/html"`;

exports[`Built in routes with simple config should handle HEAD request to directory index: response status 1`] = `200`;

exports[`Built in routes with simple config should handle HEAD request to magic async chunk: console messages 1`] = `Array []`;

exports[`Built in routes with simple config should handle HEAD request to magic async chunk: response headers content-type 1`] = `"application/javascript; charset=utf-8"`;

exports[`Built in routes with simple config should handle HEAD request to magic async chunk: response status 1`] = `200`;

exports[`Built in routes with simple config should handle HEAD request to magic async html: console messages 1`] = `Array []`;

exports[`Built in routes with simple config should handle HEAD request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;

exports[`Built in routes with simple config should handle HEAD request to magic async html: response status 1`] = `200`;

exports[`Built in routes with simple config should handles GET request to sockjs bundle: console messages 1`] = `Array []`;

exports[`Built in routes with simple config should handles GET request to sockjs bundle: page errors 1`] = `Array []`;

exports[`Built in routes with simple config should handles GET request to sockjs bundle: response headers content-type 1`] = `"application/javascript"`;

exports[`Built in routes with simple config should handles GET request to sockjs bundle: response status 1`] = `200`;

exports[`Built in routes with simple config should handles HEAD request to sockjs bundle: console messages 1`] = `Array []`;

exports[`Built in routes with simple config should handles HEAD request to sockjs bundle: page errors 1`] = `Array []`;

exports[`Built in routes with simple config should handles HEAD request to sockjs bundle: response headers content-type 1`] = `"application/javascript"`;

exports[`Built in routes with simple config should handles HEAD request to sockjs bundle: response status 1`] = `200`;
100 changes: 100 additions & 0 deletions test/e2e/__snapshots__/built-in-routes.test.js.snap.webpack5
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Built in routes with multi config should handle GET request to directory index and list all middleware directories: console messages 1`] = `Array []`;

exports[`Built in routes with multi config should handle GET request to directory index and list all middleware directories: directory list 1`] = `
"<h1>Assets Report:</h1><div><h2>Compilation: unnamed[0]</h2><ul><li>
<strong><a href=\\"/bundle1/foo.js\\" target=\\"_blank\\">foo.js</a></strong>
</li><li>
<strong><a href=\\"/bundle1/path/to/file.html\\" target=\\"_blank\\">path/to/file.html</a></strong>
</li></ul></div><div><h2>Compilation: named</h2><ul><li>
<strong><a href=\\"/bundle2/bar.js\\" target=\\"_blank\\">bar.js</a></strong>
</li></ul></div><div><h2>Compilation: other</h2><ul><li>
<strong><a href=\\"bar.js\\" target=\\"_blank\\">bar.js</a></strong>
</li></ul></div>"
`;

exports[`Built in routes with multi config should handle GET request to directory index and list all middleware directories: page errors 1`] = `Array []`;

exports[`Built in routes with multi config should handle GET request to directory index and list all middleware directories: response headers content-type 1`] = `"text/html"`;

exports[`Built in routes with multi config should handle GET request to directory index and list all middleware directories: response status 1`] = `200`;

exports[`Built in routes with simple config should handle GET request to directory index and list all middleware directories: console messages 1`] = `Array []`;

exports[`Built in routes with simple config should handle GET request to directory index and list all middleware directories: directory list 1`] = `
"<h1>Assets Report:</h1><div><h2>Compilation: unnamed</h2><ul><li>
<strong><a href=\\"main.js\\" target=\\"_blank\\">main.js</a></strong>
</li><li>
<strong><a href=\\"test.html\\" target=\\"_blank\\">test.html</a></strong>
</li></ul></div>"
`;

exports[`Built in routes with simple config should handle GET request to directory index and list all middleware directories: page errors 1`] = `Array []`;

exports[`Built in routes with simple config should handle GET request to directory index and list all middleware directories: response headers content-type 1`] = `"text/html"`;

exports[`Built in routes with simple config should handle GET request to directory index and list all middleware directories: response status 1`] = `200`;

exports[`Built in routes with simple config should handle GET request to invalidate endpoint: console messages 1`] = `Array []`;

exports[`Built in routes with simple config should handle GET request to invalidate endpoint: page errors 1`] = `Array []`;

exports[`Built in routes with simple config should handle GET request to invalidate endpoint: response status 1`] = `200`;

exports[`Built in routes with simple config should handle GET request to magic async chunk: console messages 1`] = `Array []`;

exports[`Built in routes with simple config should handle GET request to magic async chunk: response headers content-type 1`] = `"application/javascript; charset=utf-8"`;

exports[`Built in routes with simple config should handle GET request to magic async chunk: response status 1`] = `200`;

exports[`Built in routes with simple config should handle GET request to magic async html: console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
"[webpack-dev-server] Hot Module Replacement enabled.",
"[webpack-dev-server] Live Reloading enabled.",
]
`;

exports[`Built in routes with simple config should handle GET request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;

exports[`Built in routes with simple config should handle GET request to magic async html: response status 1`] = `200`;

exports[`Built in routes with simple config should handle HEAD request to directory index: console messages 1`] = `Array []`;

exports[`Built in routes with simple config should handle HEAD request to directory index: directory list 1`] = `""`;

exports[`Built in routes with simple config should handle HEAD request to directory index: page errors 1`] = `Array []`;

exports[`Built in routes with simple config should handle HEAD request to directory index: response headers content-type 1`] = `"text/html"`;

exports[`Built in routes with simple config should handle HEAD request to directory index: response status 1`] = `200`;

exports[`Built in routes with simple config should handle HEAD request to magic async chunk: console messages 1`] = `Array []`;

exports[`Built in routes with simple config should handle HEAD request to magic async chunk: response headers content-type 1`] = `"application/javascript; charset=utf-8"`;

exports[`Built in routes with simple config should handle HEAD request to magic async chunk: response status 1`] = `200`;

exports[`Built in routes with simple config should handle HEAD request to magic async html: console messages 1`] = `Array []`;

exports[`Built in routes with simple config should handle HEAD request to magic async html: response headers content-type 1`] = `"text/html; charset=utf-8"`;

exports[`Built in routes with simple config should handle HEAD request to magic async html: response status 1`] = `200`;

exports[`Built in routes with simple config should handles GET request to sockjs bundle: console messages 1`] = `Array []`;

exports[`Built in routes with simple config should handles GET request to sockjs bundle: page errors 1`] = `Array []`;

exports[`Built in routes with simple config should handles GET request to sockjs bundle: response headers content-type 1`] = `"application/javascript"`;

exports[`Built in routes with simple config should handles GET request to sockjs bundle: response status 1`] = `200`;

exports[`Built in routes with simple config should handles HEAD request to sockjs bundle: console messages 1`] = `Array []`;

exports[`Built in routes with simple config should handles HEAD request to sockjs bundle: page errors 1`] = `Array []`;

exports[`Built in routes with simple config should handles HEAD request to sockjs bundle: response headers content-type 1`] = `"application/javascript"`;

exports[`Built in routes with simple config should handles HEAD request to sockjs bundle: response status 1`] = `200`;
Loading