Skip to content
Merged
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
24 changes: 24 additions & 0 deletions src/__tests__/compiler/compiler.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,3 +381,27 @@ test("warnings", () => {
},
});
});

test("simplifies rem", () => {
const compiled = compile(`.test {
border-width: calc(10rem + 2px);
}`);

expect(compiled.stylesheet()).toStrictEqual({
s: [
[
"test",
[
{
d: [
{
borderWidth: 142,
},
],
s: [1, 1],
},
],
],
],
});
});
2 changes: 1 addition & 1 deletion src/__tests__/native/calc.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,6 @@ test("infinity", () => {

expect(component.type).toBe("View");
expect(component.props.style).toStrictEqual({
borderRadius: 9999,
borderRadius: 9007199254740990,
});
});
2 changes: 1 addition & 1 deletion src/__tests__/vendor/tailwind.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,10 @@ test("line-clamp", () => {
[
{
d: [
[1, ["numberOfLines"]],
{
overflow: "hidden",
},
[1, ["numberOfLines"]],
],
s: [1, 1],
},
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/vendor/tailwind/_tailwind.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export async function render(
console.log(`Output CSS:\n---\n${output}\n---\n`);
}

const compiled = registerCSS(output, { debug: false });
const compiled = registerCSS(output, { debug: Boolean(debug) });

if (debug) {
console.log(
Expand Down
40 changes: 0 additions & 40 deletions src/__tests__/vendor/tailwind/backgrounds.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,6 @@ describe("Backgrounds - Background Image", () => {
"linear-gradient(to top in oklab, #fb2c36 0%, #2b7fff 100%)",
},
},
warnings: {
values: {
"background-image": ["initial", "initial", "initial"],
},
},
});
});
test("bg-gradient-to-tr", async () => {
Expand All @@ -228,11 +223,6 @@ describe("Backgrounds - Background Image", () => {
"linear-gradient(to top right in oklab, #fb2c36 0%, #2b7fff 100%)",
},
},
warnings: {
values: {
"background-image": ["initial", "initial", "initial"],
},
},
});
});
test("bg-gradient-to-r", async () => {
Expand All @@ -247,11 +237,6 @@ describe("Backgrounds - Background Image", () => {
"linear-gradient(to right in oklab, #fb2c36 0%, #2b7fff 100%)",
},
},
warnings: {
values: {
"background-image": ["initial", "initial", "initial"],
},
},
});
});
test("bg-gradient-to-br", async () => {
Expand All @@ -266,11 +251,6 @@ describe("Backgrounds - Background Image", () => {
"linear-gradient(to bottom right in oklab, #fb2c36 0%, #2b7fff 100%)",
},
},
warnings: {
values: {
"background-image": ["initial", "initial", "initial"],
},
},
});
});
test("bg-gradient-to-b", async () => {
Expand All @@ -285,11 +265,6 @@ describe("Backgrounds - Background Image", () => {
"linear-gradient(to bottom in oklab, #fb2c36 0%, #2b7fff 100%)",
},
},
warnings: {
values: {
"background-image": ["initial", "initial", "initial"],
},
},
});
});
test("bg-gradient-to-bl", async () => {
Expand All @@ -304,11 +279,6 @@ describe("Backgrounds - Background Image", () => {
"linear-gradient(to bottom left in oklab, #fb2c36 0%, #2b7fff 100%)",
},
},
warnings: {
values: {
"background-image": ["initial", "initial", "initial"],
},
},
});
});
test("bg-gradient-to-l", async () => {
Expand All @@ -323,11 +293,6 @@ describe("Backgrounds - Background Image", () => {
"linear-gradient(to left in oklab, #fb2c36 0%, #2b7fff 100%)",
},
},
warnings: {
values: {
"background-image": ["initial", "initial", "initial"],
},
},
});
});
test("bg-gradient-to-tl", async () => {
Expand All @@ -342,11 +307,6 @@ describe("Backgrounds - Background Image", () => {
"linear-gradient(to top left in oklab, #fb2c36 0%, #2b7fff 100%)",
},
},
warnings: {
values: {
"background-image": ["initial", "initial", "initial"],
},
},
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/vendor/tailwind/borders.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe("Border - Border Radius", () => {
});
test("rounded-full", async () => {
expect(await renderCurrentTest()).toStrictEqual({
props: { style: { borderRadius: 9999 } },
props: { style: { borderRadius: 9007199254740990 } },
});
});
});
Expand Down
15 changes: 0 additions & 15 deletions src/__tests__/vendor/tailwind/effects.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ describe("Effects - Box Shadow", () => {
],
},
},
warnings: {
values: {
"box-shadow": ["initial", "initial", "initial", "initial", "initial"],
},
},
});
});

Expand All @@ -57,11 +52,6 @@ describe("Effects - Box Shadow", () => {
],
},
},
warnings: {
values: {
"box-shadow": ["initial", "initial", "initial", "initial", "initial"],
},
},
});
});
test("shadow-none", async () => {
Expand All @@ -71,11 +61,6 @@ describe("Effects - Box Shadow", () => {
boxShadow: [],
},
},
warnings: {
values: {
"box-shadow": ["initial", "initial", "initial", "initial", "initial"],
},
},
});
});
});
Expand Down
Loading