Skip to content

Commit

Permalink
test: add e2e tests for static.publicPath option (#3888)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Sep 30, 2021
1 parent ea5581f commit 01ed758
Show file tree
Hide file tree
Showing 4 changed files with 1,619 additions and 463 deletions.
262 changes: 262 additions & 0 deletions test/e2e/__snapshots__/static-public-path.test.js.snap.webpack4
@@ -0,0 +1,262 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`static.publicPath option Content type should handle request to example.txt: console messages 1`] = `Array []`;

exports[`static.publicPath option Content type should handle request to example.txt: page errors 1`] = `Array []`;

exports[`static.publicPath option Content type should handle request to example.txt: response header content-type 1`] = `"text/plain; charset=UTF-8"`;

exports[`static.publicPath option Content type should handle request to example.txt: response status 1`] = `200`;

exports[`static.publicPath option defaults to CWD should handle request to page: console messages 1`] = `Array []`;

exports[`static.publicPath option defaults to CWD should handle request to page: page errors 1`] = `Array []`;

exports[`static.publicPath option defaults to CWD should handle request to page: response status 1`] = `200`;

exports[`static.publicPath option defaults to CWD should handle request to page: response text 1`] = `
"Heyo.
"
`;

exports[`static.publicPath option multiple static.publicPath entries should handle request to the /foo route of second path: console messages 1`] = `Array []`;

exports[`static.publicPath option multiple static.publicPath entries should handle request to the /foo route of second path: page errors 1`] = `Array []`;

exports[`static.publicPath option multiple static.publicPath entries should handle request to the /foo route of second path: response status 1`] = `200`;

exports[`static.publicPath option multiple static.publicPath entries should handle request to the /foo route of second path: response text 1`] = `
"Foo!
"
`;

exports[`static.publicPath option multiple static.publicPath entries should handle request to the index of first path: console messages 1`] = `Array []`;

exports[`static.publicPath option multiple static.publicPath entries should handle request to the index of first path: page errors 1`] = `Array []`;

exports[`static.publicPath option multiple static.publicPath entries should handle request to the index of first path: response status 1`] = `200`;

exports[`static.publicPath option multiple static.publicPath entries should handle request to the index of first path: response text 1`] = `
"Heyo.
"
`;

exports[`static.publicPath option multiple static.publicPath entries should handle request to the other file of first path: console messages 1`] = `Array []`;

exports[`static.publicPath option multiple static.publicPath entries should handle request to the other file of first path: page errors 1`] = `Array []`;

exports[`static.publicPath option multiple static.publicPath entries should handle request to the other file of first path: response status 1`] = `200`;

exports[`static.publicPath option multiple static.publicPath entries should handle request to the other file of first path: response text 1`] = `
"Other html
"
`;

exports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the /foo route of first path: console messages 1`] = `Array []`;

exports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the /foo route of first path: page errors 1`] = `Array []`;

exports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the /foo route of first path: response status 1`] = `200`;

exports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the /foo route of first path: response text 1`] = `
"Foo!
"
`;

exports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the /foo route of second path: console messages 1`] = `Array []`;

exports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the /foo route of second path: page errors 1`] = `Array []`;

exports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the /foo route of second path: response status 1`] = `200`;

exports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the /foo route of second path: response text 1`] = `
"Foo!
"
`;

exports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the index of first path: console messages 1`] = `Array []`;

exports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the index of first path: page errors 1`] = `Array []`;

exports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the index of first path: response status 1`] = `200`;

exports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the index of first path: response text 1`] = `
"Heyo.
"
`;

exports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the other file of first path: console messages 1`] = `Array []`;

exports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the other file of first path: page errors 1`] = `Array []`;

exports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the other file of first path: response status 1`] = `200`;

exports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the other file of first path: response text 1`] = `
"Other html
"
`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should handle GET request: console messages 1`] = `Array []`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should handle GET request: page errors 1`] = `Array []`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should handle GET request: response status 1`] = `200`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should handle HEAD request: console messages 1`] = `Array []`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should handle HEAD request: page errors 1`] = `Array []`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should handle HEAD request: response status 1`] = `200`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should not handle DELETE request: console messages 1`] = `
Array [
"Failed to load resource: the server responded with a status of 404 (Not Found)",
]
`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should not handle DELETE request: page errors 1`] = `Array []`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should not handle DELETE request: response status 1`] = `404`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should not handle PATCH request: console messages 1`] = `
Array [
"Failed to load resource: the server responded with a status of 404 (Not Found)",
]
`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should not handle PATCH request: page errors 1`] = `Array []`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should not handle PATCH request: response status 1`] = `404`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should not handle POST request: console messages 1`] = `
Array [
"Failed to load resource: the server responded with a status of 404 (Not Found)",
]
`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should not handle POST request: page errors 1`] = `Array []`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should not handle POST request: response status 1`] = `404`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should not handle PUT request: console messages 1`] = `
Array [
"Failed to load resource: the server responded with a status of 404 (Not Found)",
]
`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should not handle PUT request: page errors 1`] = `Array []`;

exports[`static.publicPath option should ignore methods other than GET and HEAD should not handle PUT request: response status 1`] = `404`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex default (true) should list the files inside the assets folder (200): console messages 1`] = `Array []`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex default (true) should list the files inside the assets folder (200): page errors 1`] = `Array []`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex default (true) should list the files inside the assets folder (200): response status 1`] = `200`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex default (true) should show Heyo. because bar has index.html inside it (200): console messages 1`] = `Array []`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex default (true) should show Heyo. because bar has index.html inside it (200): page errors 1`] = `Array []`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex default (true) should show Heyo. because bar has index.html inside it (200): response status 1`] = `200`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex default (true) should show Heyo. because bar has index.html inside it (200): response text 1`] = `
"Heyo
"
`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: false should show Heyo. because bar has index.html inside it (200): console messages 1`] = `Array []`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: false should show Heyo. because bar has index.html inside it (200): page errors 1`] = `Array []`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: false should show Heyo. because bar has index.html inside it (200): response status 1`] = `200`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: false should show Heyo. because bar has index.html inside it (200): response text 1`] = `
"Heyo
"
`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: false shouldn't list the files inside the assets folder (404): console messages 1`] = `
Array [
"Failed to load resource: the server responded with a status of 404 (Not Found)",
]
`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: false shouldn't list the files inside the assets folder (404): page errors 1`] = `Array []`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: false shouldn't list the files inside the assets folder (404): response status 1`] = `404`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: false shouldn't list the files inside the assets folder (404): response text 1`] = `
"<!DOCTYPE html>
<html lang=\\"en\\">
<head>
<meta charset=\\"utf-8\\">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /serve-content-at-this-url/assets/</pre>
</body>
</html>
"
`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: true should list the files inside the assets folder (200): console messages 1`] = `Array []`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: true should list the files inside the assets folder (200): page errors 1`] = `Array []`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: true should list the files inside the assets folder (200): response status 1`] = `200`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: true should show Heyo. because bar has index.html inside it (200): console messages 1`] = `Array []`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: true should show Heyo. because bar has index.html inside it (200): page errors 1`] = `Array []`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: true should show Heyo. because bar has index.html inside it (200): response status 1`] = `200`;

exports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: true should show Heyo. because bar has index.html inside it (200): response text 1`] = `
"Heyo
"
`;

exports[`static.publicPath option to directory should handle request to index: console messages 1`] = `Array []`;

exports[`static.publicPath option to directory should handle request to index: page errors 1`] = `Array []`;

exports[`static.publicPath option to directory should handle request to index: response status 1`] = `200`;

exports[`static.publicPath option to directory should handle request to index: response text 1`] = `
"Heyo.
"
`;

exports[`static.publicPath option to directory should handle request to other file: console messages 1`] = `Array []`;

exports[`static.publicPath option to directory should handle request to other file: page errors 1`] = `Array []`;

exports[`static.publicPath option to directory should handle request to other file: response status 1`] = `200`;

exports[`static.publicPath option to directory should handle request to other file: response text 1`] = `
"Other html
"
`;

exports[`static.publicPath option to multiple directories should handle request to first directory: console messages 1`] = `Array []`;

exports[`static.publicPath option to multiple directories should handle request to first directory: page errors 1`] = `Array []`;

exports[`static.publicPath option to multiple directories should handle request to first directory: response status 1`] = `200`;

exports[`static.publicPath option to multiple directories should handle request to first directory: response text 1`] = `
"Heyo.
"
`;

exports[`static.publicPath option to multiple directories should handle request to second directory: console messages 1`] = `Array []`;

exports[`static.publicPath option to multiple directories should handle request to second directory: page errors 1`] = `Array []`;

exports[`static.publicPath option to multiple directories should handle request to second directory: response status 1`] = `200`;

exports[`static.publicPath option to multiple directories should handle request to second directory: response text 1`] = `
"Foo!
"
`;

0 comments on commit 01ed758

Please sign in to comment.