1import { describe, it, expect } from "vitest";
2import { stylesImpl, tw } from "../src/Yoga/React/Native/Style.js";
4describe("Style FFI", () => {
5 it("stylesImpl merges an array of style objects", () => {
6 const result = stylesImpl([{ flex: 1 }, { color: "red" }, { padding: 10 }]);
7 expect(result).toEqual({ flex: 1, color: "red", padding: 10 });
10 it("stylesImpl later values override earlier", () => {
11 const result = stylesImpl([{ color: "red" }, { color: "blue" }]);
12 expect(result.color).toBe("blue");
15 it("tw returns a style object from a class string", () => {
16 const result = tw("flex-1 p-4");
17 expect(result).toEqual({ _tw: "flex-1 p-4" });
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list