-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from undone-labs/feat-vitest
feat: vitest
- Loading branch information
Showing
14 changed files
with
2,785 additions
and
2,614 deletions.
There are no files selected for viewing
3 changes: 1 addition & 2 deletions
3
.github/workflows/auto-author.assign.yml → .github/workflows/author-auto-assign.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: vitest | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- stable | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- stable | ||
- develop | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- name: Installing dependencies | ||
run: npm ci | ||
- name: Running zero-core tests | ||
run: npm run zero-core:test |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { defineVitestConfig } from '@nuxt/test-utils/config' | ||
|
||
export default defineVitestConfig({ | ||
test: { | ||
environment: 'node', | ||
coverage: { | ||
provider: 'v8' | ||
}, | ||
include: ['tests/component/*.{test,spec}.?(c|m)[jt]s?(x)'] | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { defineVitestConfig } from '@nuxt/test-utils/config' | ||
|
||
export default defineVitestConfig({ | ||
test: { | ||
environment: 'nuxt', | ||
coverage: { | ||
provider: 'v8' | ||
}, | ||
include: ['tests/component/*.{test,spec}.?(c|m)[jt]s?(x)'] | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { setActivePinia, createPinia } from 'pinia' | ||
import { describe, test, expect, beforeAll, beforeEach, afterEach } from 'vitest' | ||
import { useZeroStore } from '@/stores/use-zero-store' | ||
|
||
beforeAll(() => { | ||
setActivePinia(createPinia()) | ||
}) | ||
|
||
describe('useZeroStore', () => { | ||
let zeroStore | ||
|
||
beforeEach(() => { | ||
zeroStore = useZeroStore() | ||
}) | ||
|
||
afterEach(() => { | ||
zeroStore.setSeo({}) | ||
}) | ||
|
||
test('creates a store', () => { | ||
expect(zeroStore).toBeDefined() | ||
}) | ||
|
||
test('initializes with theme light', () => { | ||
expect(zeroStore.seo).toStrictEqual({}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { defineVitestConfig } from '@nuxt/test-utils/config' | ||
|
||
export default defineVitestConfig({ | ||
test: { | ||
environment: 'nuxt', | ||
coverage: { | ||
provider: 'v8' | ||
}, | ||
include: ['tests/component/*.{test,spec}.?(c|m)[jt]s?(x)'] | ||
} | ||
}) |