Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test: fix
  • Loading branch information
alexander-akait committed Jul 14, 2021
commit ac6b02acbd24282e55d464c427c57cb8a47908b8
4 changes: 2 additions & 2 deletions test/__snapshots__/url-option.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`"url" option should resolve "file" protocol path: module 1`] = `
"// Imports
import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\";
import ___CSS_LOADER_GET_URL_IMPORT___ from \\"../../../src/runtime/getUrl.js\\";
var ___CSS_LOADER_URL_IMPORT_0___ = new URL(\\"<cwd>/test/fixtures/url/img.png\\", import.meta.url);
var ___CSS_LOADER_URL_IMPORT_0___ = new URL(\\"<file-protocol-url>\\", import.meta.url);
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]});
var ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);
// Module
Expand Down Expand Up @@ -46,7 +46,7 @@ exports[`"url" option should resolve absolute path: module 1`] = `
"// Imports
import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\";
import ___CSS_LOADER_GET_URL_IMPORT___ from \\"../../../src/runtime/getUrl.js\\";
var ___CSS_LOADER_URL_IMPORT_0___ = new URL(\\"<cwd>/test/fixtures/url/img.png\\", import.meta.url);
var ___CSS_LOADER_URL_IMPORT_0___ = new URL(\\"<absolute-path>\\", import.meta.url);
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]});
var ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);
// Module
Expand Down
8 changes: 4 additions & 4 deletions test/url-option.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ describe('"url" option', () => {

expect(
getModuleSource("./url/url-absolute.css", stats).replace(
new RegExp(process.cwd().replace(/\\/g, "/"), "g"),
"<cwd>"
absolutePath,
"<absolute-path>"
)
).toMatchSnapshot("module");
expect(getExecutedCode("main.bundle.js", compiler, stats)).toMatchSnapshot(
Expand Down Expand Up @@ -176,8 +176,8 @@ describe('"url" option', () => {

expect(
getModuleSource("./url/url-file-protocol.css", stats).replace(
new RegExp(process.cwd().replace(/\\/g, "/"), "g"),
"<cwd>"
absolutePath,
"<file-protocol-url>"
)
).toMatchSnapshot("module");
expect(getExecutedCode("main.bundle.js", compiler, stats)).toMatchSnapshot(
Expand Down