Skip to content

Commit ba9344d

Browse files
authored
Merge pull request #6 from samhirtarif/add_tests
Add tests
2 parents c40db32 + 4191581 commit ba9344d

24 files changed

+10272
-1642
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
name: Browser tests
3+
on: push
4+
5+
jobs:
6+
karma:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
with:
11+
node-version: "18.x"
12+
- name: install dependencies
13+
run: npm ci
14+
- name: Run Tests
15+
run: npm run test:browser -- --single-run

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run ESLint
1+
name: Linting
22
on: [pull_request]
33

44
env:
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
name: Unit tests
3+
on: push
4+
5+
jobs:
6+
vitest:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
with:
11+
node-version: "18.x"
12+
- name: install dependencies
13+
run: npm ci
14+
- name: Run Tests
15+
run: npm run test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ node_modules
1111
dist
1212
dist-ssr
1313
*.local
14+
coverage
1415

1516
# Editor directories and files
1617
.vscode/*

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.15.0

karma.conf.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/** @type {(config: import("karma").Config) => Promise<void> | undefined} */
2+
3+
module.exports = function (config) {
4+
config.set({
5+
plugins: [
6+
'karma-spec-reporter',
7+
'karma-jasmine',
8+
'karma-vite',
9+
'karma-chrome-launcher',
10+
],
11+
captureTimeout: 3000,
12+
browsers: ['ChromeHeadless'],
13+
frameworks: ['jasmine', 'vite'],
14+
reporters: ['spec'],
15+
files: [
16+
{
17+
pattern: 'tests/**/*.spec.tsx',
18+
type: 'module',
19+
watched: false,
20+
served: false,
21+
},
22+
],
23+
});
24+
};

0 commit comments

Comments
 (0)