Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add e2e tests for
static.publicPath
option (#3888)
- Loading branch information
Showing
4 changed files
with
1,619 additions
and
463 deletions.
There are no files selected for viewing
262 changes: 262 additions & 0 deletions
262
test/e2e/__snapshots__/static-public-path.test.js.snap.webpack4
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,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! | ||
" | ||
`; |
Oops, something went wrong.