Skip to content

Commit 8d63424

Browse files
Add tests (#1)
* Add comprehensive test suite with Vitest - Set up Vitest testing framework with jsdom environment - Add @vue/test-utils for Vue component testing - Create comprehensive tests for debugMixin functionality - Test plugin installation and global mixin behavior - Add test scripts to package.json - Mock console methods to verify debug output - Test all log levels and configuration options - Verify lifecycle event logging * Fix tests to work with jsdom environment - Configure Vite properly for jsdom test environment - Update tests to match actual component behavior in test environment - Fix component naming expectations (falls back to 'Anonymous' in tests) - Test production environment behavior (no comments added) - Test HTML comment insertion and cleanup functionality - All 16 tests now passing * Add GitHub Actions CI workflow - Run tests on push to main and add-tests branches - Test on Node.js 18.x, 20.x, and 22.x - Run tests, build, and prettier formatting checks - Use npm ci for faster, reliable installs - Trigger on pull requests to main branch * Rename actions workflow * Run Prettier
1 parent 3a02510 commit 8d63424

File tree

6 files changed

+2851
-137
lines changed

6 files changed

+2851
-137
lines changed

.github/workflows/tests.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
node-version: [18.x, 20.x, 22.x]
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: 'npm'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Run tests
29+
run: npm run test:run
30+
31+
- name: Run build
32+
run: npm run build
33+
34+
- name: Check formatting
35+
run: npm run prettier:check

0 commit comments

Comments
 (0)