Skip to content

Commit 5ebe2a7

Browse files
authored
Add unit tests (#99)
1 parent 04ca1ba commit 5ebe2a7

File tree

8 files changed

+39
-13
lines changed

8 files changed

+39
-13
lines changed

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,4 @@ npm-debug.log*
5757

5858
dist/
5959
docs/api/
60-
site/
61-
62-
tests/
63-
jest.config.*
60+
site/

jest.config.cjs

Lines changed: 0 additions & 6 deletions
This file was deleted.

package-lock.json

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@
3535
"build": "rollup -c",
3636
"build:watch": "rollup -c -w",
3737
"clean": "rimraf dist && rimraf node_modules && rimraf package-lock.json",
38-
"docs:api": "typedoc"
38+
"docs:api": "typedoc",
39+
"test": "vitest",
40+
"test:unit": "vitest tests/unit",
41+
"test:watch": "vitest --watch",
42+
"test:ui": "vitest --ui",
43+
"test:coverage": "vitest --coverage"
3944
},
4045
"dependencies": {
4146
"@opentelemetry/sdk-logs": "^0.204.0",
@@ -49,14 +54,17 @@
4954
"@rollup/plugin-typescript": "^11.1.0",
5055
"@types/node": "^20.11.19",
5156
"@types/uuid": "^9.0.8",
57+
"@vitest/coverage-v8": "^3.2.4",
58+
"@vitest/ui": "^3.2.4",
5259
"builtin-modules": "^3.3.0",
5360
"dotenv": "^17.2.0",
5461
"rimraf": "^6.0.1",
5562
"rollup": "^4.0.0",
5663
"rollup-plugin-dts": "^6.1.0",
5764
"typedoc": "^0.28.13",
5865
"typedoc-plugin-markdown": "^4.8.1",
59-
"typescript": "^5.3.3"
66+
"typescript": "^5.3.3",
67+
"vitest": "^3.2.4"
6068
},
6169
"repository": {
6270
"type": "git",

tests/unit/services/tasks.test.ts

Whitespace-only changes.

tests/utils/mocks/core.ts

Whitespace-only changes.

tests/utils/setup.ts

Whitespace-only changes.

vitest.config.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { defineConfig } from 'vitest/config';
2+
3+
export default defineConfig({
4+
test: {
5+
globals: true,
6+
environment: 'node',
7+
include: ['tests/**/*.test.ts'],
8+
coverage: {
9+
provider: 'v8',
10+
reporter: ['text', 'json', 'html'],
11+
exclude: [
12+
'node_modules/',
13+
'tests/',
14+
'dist/',
15+
'samples/**',
16+
'packages/cli/**',
17+
'docs/**',
18+
'**/*.d.ts',
19+
'**/*.config.*',
20+
'**/index.ts',
21+
],
22+
},
23+
},
24+
});

0 commit comments

Comments
 (0)