Skip to content

Commit f156594

Browse files
committed
Vitest setup / Tests
1 parent f07bc7b commit f156594

File tree

17 files changed

+5451
-101
lines changed

17 files changed

+5451
-101
lines changed

.github/workflows/publishPackage.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ name: Publish NPM package
33
on:
44
push:
55
branches:
6-
- "stable"
7-
tags:
8-
- "**"
6+
- stable
97

108
workflow_dispatch:
119

1210
jobs:
1311
build:
1412
name: Build package
1513
runs-on: ubuntu-latest
14+
if: github.repository_owner == 'float-toolkit'
1615

1716
steps:
1817
- name: Checkout repository
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Test with Vitest
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- stable
7+
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
name: Test package
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Install dependencies
20+
run: npm ci
21+
22+
- name: Test
23+
run: npm test
24+
25+
- name: Report coverage to Codecov
26+
uses: codecov/codecov-action@v3
27+
with:
28+
fail_ci_if_error: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
/dist
66
/typings
77

8+
# testing and coverage
9+
/coverage
10+
811
# IDEs and editors
912
/.idea
1013
.project

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
/.github
77
.gitignore
88

9+
# testing and coverage
10+
/coverage
11+
912
# IDEs and editors
1013
/.idea
1114
.project

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# dependencies
22
/node_modules
33

4+
# testing and coverage
5+
/coverage
6+
47
# production
58
/dist
69
/typings

.vscode/tasks.json

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,26 @@
33

44
"tasks": [
55
{
6-
"label": "TypeScript: Watch Mode",
6+
"label": "Vitest: Test",
77

8-
"type": "typescript",
9-
"tsconfig": "tsconfig.json",
10-
"option": "watch",
8+
"type": "npm",
9+
"script": "test",
1110

1211
"isBackground": true,
13-
"group": "build"
12+
"group": {
13+
"kind": "test",
14+
"isDefault": true
15+
}
16+
},
17+
18+
{
19+
"label": "Vitest: Watch Mode",
20+
21+
"type": "npm",
22+
"script": "testWatch",
23+
24+
"isBackground": true,
25+
"group": "test"
1426
},
1527

1628
{
@@ -32,6 +44,15 @@
3244
"group": "build"
3345
},
3446

47+
{
48+
"label": "NPM: Link local dependencies",
49+
50+
"type": "shell",
51+
"command": "npm link ${input:localPackages}",
52+
53+
"problemMatcher": []
54+
},
55+
3556
{
3657
"label": "NPM: Install dependencies",
3758

@@ -94,6 +115,12 @@
94115
"type": "promptString"
95116
},
96117

118+
{
119+
"id": "localPackages",
120+
"description": "Local dependencies to link",
121+
"type": "promptString"
122+
},
123+
97124
{
98125
"id": "delPackages",
99126
"description": "Dependencies to uninstall",

0 commit comments

Comments
 (0)