Skip to content

Commit

Permalink
update flex test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattstyles committed Apr 12, 2024
1 parent 0f51134 commit 3233279
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 40 deletions.
Binary file modified bun.lockb
Binary file not shown.
83 changes: 43 additions & 40 deletions packages/layout/flex/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
42 changes: 42 additions & 0 deletions packages/layout/flex/src/index.test.tsx
Original file line number Diff line number Diff line change
@@ -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(<Flex data-testid="some-id" />);
// console.log(Flex);

document.body.innerHTML = "<button>My button</button>";
const button = document.querySelector("button");
expect(button?.innerText).toEqual("My button");

const foo = 5;
expect(foo).toBe(5);
});
});

0 comments on commit 3233279

Please sign in to comment.