git.iko.soy/rowtype-yoga/purescript-yoga-react-native
on v0.2.0 help sign in
19 lines 603 B history raw
1import { describe, it, expect } from "vitest";
2import { getStringImpl, setString } from "../src/Yoga/React/Native/Clipboard.js";
4describe("Clipboard FFI", () => {
5 it("getStringImpl returns a cancellable aff", async () => {
6 let result;
7 const cancel = getStringImpl(
8 (err) => { throw err; },
9 (val) => { result = val; }
10 );
11 await new Promise((r) => setTimeout(r, 10));
12 expect(result).toBe("clipboard-content");
13 expect(typeof cancel).toBe("function");
14 });
16 it("setString is a curried effect", () => {
17 expect(() => setString("hello")()).not.toThrow();
18 });
19});