Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 3 additions & 4 deletions test/bundler/css/css-modules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ import { itBundled } from "../expectBundled";
describe("css", () => {
itBundled("css-module/GlobalPseudoFunction", {
files: {
"index.module.css": /* css */ `
"/index.module.css": /* css */ `
:global(.foo) {
color: red;
}
`,
},
outdir: "/out",
entryPoints: ["/index.module.css"],
outfile: "/out.css",
onAfterBundle(api) {
api.expectFile("/out/index.module.css").toEqualIgnoringWhitespace(`
api.expectFile("/out.css").toEqualIgnoringWhitespace(`
/* index.module.css */
.foo {
color: red;
Expand Down
7 changes: 3 additions & 4 deletions test/bundler/css/is-selector-21169.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ import { itBundled } from "../expectBundled";
describe("css", () => {
itBundled("css/is-selector", {
files: {
"index.css": /* css */ `
"/index.css": /* css */ `
.foo:is(input:checked) {
color: red;
}
`,
},
outdir: "/out",
entryPoints: ["/index.css"],
outfile: "/out.css",
onAfterBundle(api) {
api.expectFile("/out/index.css").toMatchInlineSnapshot(`
api.expectFile("/out.css").toMatchInlineSnapshot(`
"/* index.css */
.foo:-webkit-any(input:checked) {
color: red;
Expand Down
7 changes: 3 additions & 4 deletions test/bundler/css/view-transition-23600.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { itBundled } from "../expectBundled";
describe("css", () => {
itBundled("css/view-transition-class-selector-23600", {
files: {
"index.css": /* css */ `
"/index.css": /* css */ `
@keyframes slide-out {
from {
opacity: 1;
Expand Down Expand Up @@ -33,10 +33,9 @@ describe("css", () => {
}
`,
},
outdir: "/out",
entryPoints: ["/index.css"],
outfile: "/out.css",
onAfterBundle(api) {
api.expectFile("/out/index.css").toMatchInlineSnapshot(`
api.expectFile("/out.css").toMatchInlineSnapshot(`
"/* index.css */
@keyframes slide-out {
from {
Expand Down
3 changes: 2 additions & 1 deletion test/bundler/css/wpt/background-computed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import { itBundled } from "../../expectBundled";
const runTest = (property: string, input: string, expected: string) => {
const testTitle = `${property}: ${input}`;
itBundled(testTitle, {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
${property}: ${input}
}
`,
},
outfile: "out.css",
outfile: "/out.css",

onAfterBundle(api) {
api.expectFile("/out.css").toEqualIgnoringWhitespace(`
Expand Down
3 changes: 2 additions & 1 deletion test/bundler/css/wpt/color-computed-rgb.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import { itBundled } from "../../expectBundled";
const runTest = (testTitle: string, input: string, expected: string) => {
testTitle = testTitle.length === 0 ? input : testTitle;
itBundled(testTitle, {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
color: ${input}
}
`,
},
outfile: "out.css",
outfile: "/out.css",

onAfterBundle(api) {
api.expectFile("/out.css").toEqualIgnoringWhitespace(`
Expand Down
3 changes: 2 additions & 1 deletion test/bundler/css/wpt/color-computed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import { itBundled } from "../../expectBundled";

const runTest = (input: string, expected: string) => {
itBundled(input, {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
color: ${input}
}
`,
},
outfile: "out.css",
outfile: "/out.css",

onAfterBundle(api) {
api.expectFile("/out.css").toEqualIgnoringWhitespace(`
Expand Down
29 changes: 28 additions & 1 deletion test/bundler/css/wpt/relative_color_out_of_gamut.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ let i = 0;
const testname = () => `test-${i++}`;
describe("relative_color_out_of_gamut", () => {
itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
color: rgb(from color(display-p3 0 1 0) r g b / alpha);
}
`,
},
outfile: "out.css",
outfile: "/out.css",

onAfterBundle(api) {
api.expectFile("/out.css").toEqualIgnoringWhitespace(`
Expand All @@ -25,6 +26,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -45,6 +47,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -65,6 +68,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -85,6 +89,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -105,6 +110,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -125,6 +131,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -145,6 +152,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -165,6 +173,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -185,6 +194,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -205,6 +215,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -225,6 +236,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -245,6 +257,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -265,6 +278,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -285,6 +299,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -305,6 +320,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -325,6 +341,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -345,6 +362,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -365,6 +383,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -385,6 +404,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -405,6 +425,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -425,6 +446,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -445,6 +467,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -465,6 +488,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -485,6 +509,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -505,6 +530,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand All @@ -525,6 +551,7 @@ h1 {
});

itBundled(testname(), {
virtual: true,
files: {
"/a.css": /* css */ `
h1 {
Expand Down
14 changes: 7 additions & 7 deletions test/bundler/esbuild/css.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ describe("bundler", () => {
color: black }
`,
},
outfile: "/out.js",
outfile: "/out.css",
onAfterBundle(api) {
api.expectFile("/out.js").toEqualIgnoringWhitespace(`
api.expectFile("/out.css").toEqualIgnoringWhitespace(`
/* entry.css */
body {
color: #000;
Expand All @@ -31,9 +31,9 @@ describe("bundler", () => {
files: {
"/entry.css": /* css */ `\n`,
},
outfile: "/out.js",
outfile: "/out.css",
onAfterBundle(api) {
api.expectFile("/out.js").toEqualIgnoringWhitespace(`
api.expectFile("/out.css").toEqualIgnoringWhitespace(`
/* entry.css */`);
},
});
Expand All @@ -48,12 +48,12 @@ describe("bundler", () => {
}
}`,
},
outfile: "/out.js",
outfile: "/out.css",
onAfterBundle(api) {
api.expectFile("/out.js").toEqualIgnoringWhitespace(`
api.expectFile("/out.css").toEqualIgnoringWhitespace(`
/* entry.css */
body {
&h1 {
& h1 {
color: #fff;
}
}
Expand Down
Loading