Skip to content

Commit

Permalink
test: add e2e tests for built in routes (#3669)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 authored Aug 18, 2021
1 parent 4d1cbe1 commit 8915fb8
Show file tree
Hide file tree
Showing 6 changed files with 574 additions and 183 deletions.
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

0 comments on commit 8915fb8

Please sign in to comment.