Skip to content

Commit 5cb1dab

Browse files
authored
chore: move compiler tests (#120)
1 parent cb96ff1 commit 5cb1dab

File tree

7 files changed

+74
-62
lines changed

7 files changed

+74
-62
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { render, screen } from "@testing-library/react-native";
2+
import { compile } from "react-native-css/compiler";
23
import { View } from "react-native-css/components";
34
import { registerCSS, testID } from "react-native-css/jest";
45

5-
import { compile } from "../compiler";
6-
76
test("@prop target (nested @media)", () => {
87
const compiled = registerCSS(`
98
.my-class {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { compile } from "../compiler";
1+
import { compile } from "react-native-css/compiler";
22

33
test("hello world", () => {
44
const compiled = compile(`
File renamed without changes.

src/compiler/__tests__/media-query.test.ts renamed to src/__tests__/compiler/media-query.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { compile } from "../compiler";
1+
import { compile } from "react-native-css/compiler";
22

33
describe.skip("platform media queries", () => {
44
test("android", () => {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getClassNameSelectors } from "../selector-builder";
1+
import { getClassNameSelectors } from "../../compiler/selector-builder";
22

33
test("empty", () => {
44
expect(getClassNameSelectors([])).toStrictEqual([]);
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import { compile } from "react-native-css/compiler";
2+
3+
test("test compiler", () => {
4+
const compiled = compile(
5+
`
6+
.test {
7+
animation: slide-in 1s;
8+
}
9+
10+
@keyframes slide-in {
11+
from {
12+
margin-left: 100%;
13+
}
14+
15+
to {
16+
margin-left: 0%;
17+
}
18+
}
19+
`,
20+
);
21+
22+
expect(compiled.stylesheet()).toStrictEqual({
23+
k: [
24+
[
25+
"slide-in",
26+
[
27+
[
28+
"from",
29+
[
30+
{
31+
marginLeft: "100%",
32+
},
33+
],
34+
],
35+
[
36+
"to",
37+
[
38+
{
39+
marginLeft: "0%",
40+
},
41+
],
42+
],
43+
],
44+
],
45+
],
46+
s: [
47+
[
48+
"test",
49+
[
50+
{
51+
a: true,
52+
d: [
53+
[[[{}, "animationName", ["slide-in"], 1]], "animationName"],
54+
{
55+
animationDelay: [0],
56+
animationDirection: ["normal"],
57+
animationDuration: [1000],
58+
animationFillMode: ["none"],
59+
animationIterationCount: [1],
60+
animationPlayState: ["running"],
61+
animationTimingFunction: "ease",
62+
},
63+
],
64+
s: [1, 1],
65+
},
66+
],
67+
],
68+
],
69+
});
70+
});

src/compiler/__tests__/unstable_animations.test.ts

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)