diff --git a/bun.lockb b/bun.lockb index 0866bb9..373c841 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/packages/layout/flex/package.json b/packages/layout/flex/package.json index 7548436..dfadc9a 100644 --- a/packages/layout/flex/package.json +++ b/packages/layout/flex/package.json @@ -1,42 +1,45 @@ { - "name": "@urban-ui/flex", - "version": "0.4.0", - "type": "module", - "module": "./dist/index.js", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs" - } - }, - "license": "MIT", - "scripts": { - "lint": "biome lint src", - "type:check": "tsc", - "clean": "del dist", - "dev": "arc watch", - "build": "arc build" - }, - "dependencies": { - "@radix-ui/react-slot": "^1.0.2", - "@stylexjs/stylex": "^0.5.1", - "@urban-ui/theme": "^0.4.0" - }, - "peerDependencies": { - "react": "^18.2.0" - }, - "devDependencies": { - "@stylexjs/babel-plugin": "^0.5.1", - "@stylexjs/nextjs-plugin": "^0.5.1", - "@types/node": "^20.12.2", - "@types/react": "^18.2.0", - "@types/react-dom": "^18.2.0", - "config-ts": "workspace:*", - "del-cli": "^5.1.0", - "react": "^18.2.0", - "typescript": "^5.4.3" - } + "name": "@urban-ui/flex", + "version": "0.4.0", + "type": "module", + "module": "./dist/index.js", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } + }, + "license": "MIT", + "scripts": { + "lint": "biome lint src", + "type:check": "tsc", + "clean": "del dist", + "dev": "arc watch", + "build": "arc build", + "test": "bun test" + }, + "dependencies": { + "@radix-ui/react-slot": "^1.0.2", + "@stylexjs/stylex": "^0.5.1", + "@urban-ui/theme": "^0.4.0" + }, + "peerDependencies": { + "react": "^18.2.0" + }, + "devDependencies": { + "@happy-dom/global-registrator": "^14.7.1", + "@stylexjs/babel-plugin": "^0.5.1", + "@stylexjs/dev-runtime": "^0.5.1", + "@stylexjs/nextjs-plugin": "^0.5.1", + "@types/node": "^20.12.2", + "@types/react": "^18.2.0", + "@types/react-dom": "^18.2.0", + "config-ts": "workspace:*", + "del-cli": "^5.1.0", + "react": "^18.2.0", + "typescript": "^5.4.3" + } } diff --git a/packages/layout/flex/src/index.test.tsx b/packages/layout/flex/src/index.test.tsx new file mode 100644 index 0000000..614e2f7 --- /dev/null +++ b/packages/layout/flex/src/index.test.tsx @@ -0,0 +1,42 @@ +import { afterEach, beforeEach, describe, expect, test } from "bun:test"; +import { render, screen } from "@testing-library/react"; + +import { GlobalRegistrator } from "@happy-dom/global-registrator"; +import inject from "@stylexjs/dev-runtime"; + +GlobalRegistrator.register(); + +// console.log(inject); +// inject({ +// classNamePrefix: "x", +// dev: false, +// test: true, +// useRemForFontSize: false, +// styleResolution: "application-order", +// }); + +import { Flex } from "./index.ts"; + +// beforeEach(() => { +// inject({ +// classNamePrefix: "x", +// dev: false, +// test: true, +// useRemForFontSize: false, +// styleResolution: "application-order", +// }); +// }); + +describe("flex", () => { + test("Forwards the test-id", () => { + // const output = render(); + // console.log(Flex); + + document.body.innerHTML = ""; + const button = document.querySelector("button"); + expect(button?.innerText).toEqual("My button"); + + const foo = 5; + expect(foo).toBe(5); + }); +});