Skip to content

Commit

Permalink
test: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored Dec 17, 2019
1 parent 7768fce commit 609263a
Show file tree
Hide file tree
Showing 23 changed files with 869 additions and 456 deletions.
3 changes: 0 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ jobs:
node-10-canary:
node_version: ^10.13.0
webpack_version: next
continue_on_error: true
steps:
- task: NodeTool@0
inputs:
Expand Down Expand Up @@ -115,7 +114,6 @@ jobs:
node-10-canary:
node_version: ^10.13.0
webpack_version: next
continue_on_error: true
steps:
- task: NodeTool@0
inputs:
Expand Down Expand Up @@ -172,7 +170,6 @@ jobs:
node-10-canary:
node_version: ^10.13.0
webpack_version: next
continue_on_error: true
steps:
- script: 'git config --global core.autocrlf input'
displayName: 'Config git core.autocrlf'
Expand Down
11 changes: 6 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"dist"
],
"peerDependencies": {
"webpack": "^4.0.0"
"webpack": "^4.0.0 || ^5.0.0"
},
"dependencies": {
"loader-utils": "^1.2.3",
Expand All @@ -58,7 +58,7 @@
"babel-jest": "^24.9.0",
"commitlint-azure-pipelines-cli": "^1.0.2",
"cross-env": "^6.0.3",
"css-loader": "webpack-contrib/css-loader#master",
"css-loader": "^3.4.0",
"del": "^5.1.0",
"del-cli": "^3.0.0",
"es-check": "^5.1.0",
Expand Down
204 changes: 198 additions & 6 deletions test/__snapshots__/loader.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,54 @@ exports[`loader should work when ref is negative when the "injectType" option is
exports[`loader should work when ref is negative when the "injectType" option is "lazyStyleTag": warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "lazySingletonStyleTag" and CommonJS module syntax used: DOM 1`] = `
"<!DOCTYPE html><html><head>
<title>style-loader test</title>
<style id=\\"existing-style\\">.existing { color: yellow }</style>
<style>body {
color: red;
}
h1 {
color: blue;
}
</style></head>
<body>
<h1>Body</h1>
<div class=\\"target\\"></div>
<iframe class=\\"iframeTarget\\"></iframe>
</body></html>"
`;
exports[`loader should work when the "injectType" option is "lazySingletonStyleTag" and CommonJS module syntax used: errors 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "lazySingletonStyleTag" and CommonJS module syntax used: warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "lazySingletonStyleTag" and ES module syntax used: DOM 1`] = `
"<!DOCTYPE html><html><head>
<title>style-loader test</title>
<style id=\\"existing-style\\">.existing { color: yellow }</style>
<style>body {
color: red;
}
h1 {
color: blue;
}
</style></head>
<body>
<h1>Body</h1>
<div class=\\"target\\"></div>
<iframe class=\\"iframeTarget\\"></iframe>
</body></html>"
`;
exports[`loader should work when the "injectType" option is "lazySingletonStyleTag" and ES module syntax used: errors 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "lazySingletonStyleTag" and ES module syntax used: warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "lazySingletonStyleTag": DOM 1`] = `
"<!DOCTYPE html><html><head>
<title>style-loader test</title>
Expand All @@ -338,6 +386,54 @@ exports[`loader should work when the "injectType" option is "lazySingletonStyleT
exports[`loader should work when the "injectType" option is "lazySingletonStyleTag": warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "lazyStyleTag" and CommonJS module syntax used: DOM 1`] = `
"<!DOCTYPE html><html><head>
<title>style-loader test</title>
<style id=\\"existing-style\\">.existing { color: yellow }</style>
<style>body {
color: red;
}
</style><style>h1 {
color: blue;
}
</style></head>
<body>
<h1>Body</h1>
<div class=\\"target\\"></div>
<iframe class=\\"iframeTarget\\"></iframe>
</body></html>"
`;
exports[`loader should work when the "injectType" option is "lazyStyleTag" and CommonJS module syntax used: errors 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "lazyStyleTag" and CommonJS module syntax used: warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "lazyStyleTag" and ES module syntax used: DOM 1`] = `
"<!DOCTYPE html><html><head>
<title>style-loader test</title>
<style id=\\"existing-style\\">.existing { color: yellow }</style>
<style>body {
color: red;
}
</style><style>h1 {
color: blue;
}
</style></head>
<body>
<h1>Body</h1>
<div class=\\"target\\"></div>
<iframe class=\\"iframeTarget\\"></iframe>
</body></html>"
`;
exports[`loader should work when the "injectType" option is "lazyStyleTag" and ES module syntax used: errors 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "lazyStyleTag" and ES module syntax used: warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "lazyStyleTag": DOM 1`] = `
"<!DOCTYPE html><html><head>
<title>style-loader test</title>
Expand All @@ -362,7 +458,7 @@ exports[`loader should work when the "injectType" option is "lazyStyleTag": erro
exports[`loader should work when the "injectType" option is "lazyStyleTag": warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "linkTag" and "file-loader" uses CommonJS module syntax: DOM 1`] = `
exports[`loader should work when the "injectType" option is "linkTag" and CommonJS module syntax used: DOM 1`] = `
"<!DOCTYPE html><html><head>
<title>style-loader test</title>
<style id=\\"existing-style\\">.existing { color: yellow }</style>
Expand All @@ -376,11 +472,11 @@ exports[`loader should work when the "injectType" option is "linkTag" and "file-
</body></html>"
`;
exports[`loader should work when the "injectType" option is "linkTag" and "file-loader" uses CommonJS module syntax: errors 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "linkTag" and CommonJS module syntax used: errors 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "linkTag" and "file-loader" uses CommonJS module syntax: warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "linkTag" and CommonJS module syntax used: warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "linkTag" and "file-loader" uses ES module syntax: DOM 1`] = `
exports[`loader should work when the "injectType" option is "linkTag" and ES module syntax used: DOM 1`] = `
"<!DOCTYPE html><html><head>
<title>style-loader test</title>
<style id=\\"existing-style\\">.existing { color: yellow }</style>
Expand All @@ -394,9 +490,9 @@ exports[`loader should work when the "injectType" option is "linkTag" and "file-
</body></html>"
`;
exports[`loader should work when the "injectType" option is "linkTag" and "file-loader" uses ES module syntax: errors 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "linkTag" and ES module syntax used: errors 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "linkTag" and "file-loader" uses ES module syntax: warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "linkTag" and ES module syntax used: warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "linkTag": DOM 1`] = `
"<!DOCTYPE html><html><head>
Expand All @@ -416,6 +512,54 @@ exports[`loader should work when the "injectType" option is "linkTag": errors 1`
exports[`loader should work when the "injectType" option is "linkTag": warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "singletonStyleTag" and CommonJS module syntax used: DOM 1`] = `
"<!DOCTYPE html><html><head>
<title>style-loader test</title>
<style id=\\"existing-style\\">.existing { color: yellow }</style>
<style>body {
color: red;
}
h1 {
color: blue;
}
</style></head>
<body>
<h1>Body</h1>
<div class=\\"target\\"></div>
<iframe class=\\"iframeTarget\\"></iframe>
</body></html>"
`;
exports[`loader should work when the "injectType" option is "singletonStyleTag" and CommonJS module syntax used: errors 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "singletonStyleTag" and CommonJS module syntax used: warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "singletonStyleTag" and ES module syntax used: DOM 1`] = `
"<!DOCTYPE html><html><head>
<title>style-loader test</title>
<style id=\\"existing-style\\">.existing { color: yellow }</style>
<style>body {
color: red;
}
h1 {
color: blue;
}
</style></head>
<body>
<h1>Body</h1>
<div class=\\"target\\"></div>
<iframe class=\\"iframeTarget\\"></iframe>
</body></html>"
`;
exports[`loader should work when the "injectType" option is "singletonStyleTag" and ES module syntax used: errors 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "singletonStyleTag" and ES module syntax used: warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "singletonStyleTag": DOM 1`] = `
"<!DOCTYPE html><html><head>
<title>style-loader test</title>
Expand All @@ -440,6 +584,54 @@ exports[`loader should work when the "injectType" option is "singletonStyleTag":
exports[`loader should work when the "injectType" option is "singletonStyleTag": warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "styleTag" and CommonJS module syntax used: DOM 1`] = `
"<!DOCTYPE html><html><head>
<title>style-loader test</title>
<style id=\\"existing-style\\">.existing { color: yellow }</style>
<style>body {
color: red;
}
</style><style>h1 {
color: blue;
}
</style></head>
<body>
<h1>Body</h1>
<div class=\\"target\\"></div>
<iframe class=\\"iframeTarget\\"></iframe>
</body></html>"
`;
exports[`loader should work when the "injectType" option is "styleTag" and CommonJS module syntax used: errors 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "styleTag" and CommonJS module syntax used: warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "styleTag" and ES module syntax used: DOM 1`] = `
"<!DOCTYPE html><html><head>
<title>style-loader test</title>
<style id=\\"existing-style\\">.existing { color: yellow }</style>
<style>body {
color: red;
}
</style><style>h1 {
color: blue;
}
</style></head>
<body>
<h1>Body</h1>
<div class=\\"target\\"></div>
<iframe class=\\"iframeTarget\\"></iframe>
</body></html>"
`;
exports[`loader should work when the "injectType" option is "styleTag" and ES module syntax used: errors 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "styleTag" and ES module syntax used: warnings 1`] = `Array []`;
exports[`loader should work when the "injectType" option is "styleTag": DOM 1`] = `
"<!DOCTYPE html><html><head>
<title>style-loader test</title>
Expand Down
Loading

0 comments on commit 609263a

Please sign in to comment.