Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create bun:test CI #4

Merged
merged 4 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/bun-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Run Bun Tests

on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.1.27

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Run tests
run: bun test
Binary file modified bun.lockb
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"workspaces": [
"apps/*",
"packages/*",
"tooling/*"
"tooling/*",
"test"
],
"scripts": {
"__BUILD_____________": "",
Expand Down
1 change: 1 addition & 0 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
..
13 changes: 13 additions & 0 deletions test/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import baseConfig from "@good-dog/eslint/base";
import nextjsConfig from "@good-dog/eslint/nextjs";
import reactConfig from "@good-dog/eslint/react";

/** @type {import('typescript-eslint').Config} */
export default [
{
ignores: [],
},
...baseConfig,
...nextjsConfig,
...reactConfig,
];
5 changes: 5 additions & 0 deletions test/example.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { expect, test } from "bun:test";

test("2 + 2", () => {
expect(2 + 2).toBe(4);
});
1 change: 1 addition & 0 deletions test/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const name = "test";
23 changes: 23 additions & 0 deletions test/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "@good-dog/test",
"private": true,
"version": "0.1.0",
"type": "module",
"license": "MIT",
"scripts": {
"clean": "rm -rf .turbo node_modules",
"format": "prettier --check . --ignore-path ../.gitignore",
"lint": "eslint",
"typecheck": "tsc --noEmit --emitDeclarationOnly false"
},
"devDependencies": {
"@good-dog/eslint": "workspace:*",
"@good-dog/prettier": "workspace:*",
"@good-dog/typescript": "workspace:*",
"@types/bun": "^1.1.10",
"eslint": "9.10.0",
"prettier": "3.2.5",
"typescript": "5.4.5"
},
"prettier": "@good-dog/prettier"
}
8 changes: 8 additions & 0 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "@good-dog/typescript/base.json",
"compilerOptions": {
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
},
"include": ["**/*.test.ts", "*.ts"],
"exclude": ["node_modules"]
}