Skip to content

Commit de7cf17

Browse files
committed
tests
1 parent 38c964f commit de7cf17

File tree

5 files changed

+991
-8
lines changed

5 files changed

+991
-8
lines changed

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20.19'
21+
cache: 'yarn'
22+
23+
- name: Install dependencies
24+
run: yarn install --frozen-lockfile
25+
26+
- name: Run tests
27+
run: yarn test:run
28+
29+
- name: Build project
30+
run: yarn build

package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
"dev": "vite",
1111
"build": "vite build",
1212
"preview": "vite preview",
13-
"plugin:build": "vite build && cp manifest.json dist/"
13+
"plugin:build": "vite build && cp manifest.json dist/",
14+
"test": "vitest",
15+
"test:run": "vitest run"
1416
},
1517
"dependencies": {
1618
"@ai-sdk/anthropic": "^1.2.12",
1719
"@ai-sdk/google": "^1.2.22",
1820
"@ai-sdk/openai": "^1.3.22",
1921
"@ai-sdk/vue": "^1.2.12",
20-
"@beekeeperstudio/plugin": "^1.4.0",
22+
"@beekeeperstudio/plugin": "^1.4.0-beta.6",
2123
"@langchain/core": "^0.3.61",
2224
"@material-symbols/font-400": "^0.31.2",
2325
"ai": "^4.3.16",
@@ -37,7 +39,12 @@
3739
"@beekeeperstudio/vite-plugin": "^1.0.3",
3840
"@types/lodash": "^4.17.16",
3941
"@vitejs/plugin-vue": "^5.0.4",
42+
"@vitest/browser": "^3.2.4",
43+
"@vue/test-utils": "^2.4.6",
44+
"happy-dom": "^18.0.1",
4045
"sass": "^1.87.0",
41-
"vite": "^6.2.3"
46+
"vite": "^6.2.3",
47+
"vitest": "^3.2.4",
48+
"vitest-browser-vue": "^1.1.0"
4249
}
4350
}

tests/example.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { it, expect } from "vitest";
2+
3+
it("can run a test", () => {
4+
expect(true).toBe(true);
5+
});

vitest.config.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { defineConfig } from 'vitest/config'
2+
import vue from '@vitejs/plugin-vue'
3+
import { resolve } from 'path'
4+
5+
export default defineConfig({
6+
plugins: [vue()],
7+
test: {
8+
environment: 'happy-dom',
9+
include: ['tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}']
10+
},
11+
resolve: {
12+
alias: {
13+
'@': resolve(__dirname, './src')
14+
}
15+
}
16+
})

0 commit comments

Comments
 (0)