Skip to content

Commit c7ca8a4

Browse files
authored
Merge pull request #16 from thavelick/add-jsdom-testing
Migrate to Bun test runner with jsdom support
2 parents fe712fe + 2c3d7e3 commit c7ca8a4

File tree

9 files changed

+708
-20
lines changed

9 files changed

+708
-20
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.claude/
1+
.claude/
2+
node_modules/

CLAUDE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The `= window` default parameter makes the real browser object the default, allo
3434
### Essential Commands
3535
```bash
3636
make dev # Starts Python HTTP server on port 8000. Don't run this. Ask me if you think it needs to be started
37-
make test # Run Jest unit tests
37+
make test # Run unit tests with Bun
3838
make format # Auto-format code with Biome
3939
make lint # Check linting with Biome
4040
make check # Run both formatting and linting checks
@@ -43,10 +43,10 @@ make check # Run both formatting and linting checks
4343
### Running Specific Tests
4444
```bash
4545
# Run single test file
46-
bunx jest tests/search.spec.js -c '{"testMatch":["**/tests/**/*.spec.js"]}'
46+
bun test tests/search.spec.js
4747

4848
# Run specific test pattern
49-
bunx jest -t "processBang" -c '{"testMatch":["**/tests/**/*.spec.js"]}'}
49+
bun test -t "processBang"
5050
```
5151

5252
## Code Quality Tools
@@ -57,9 +57,9 @@ bunx jest -t "processBang" -c '{"testMatch":["**/tests/**/*.spec.js"]}'}
5757
- **GitHub Actions**: `code-quality.yml` workflow runs `biome check` and fails builds on issues
5858

5959
### Module System
60-
- **Browser**: Regular script tags (no ES6 modules due to Jest compatibility issues)
61-
- **Tests**: CommonJS require/module.exports
62-
- **No package.json**: By design - staying dependency-free except for Jest
60+
- **Browser**: Regular script tags (no ES6 modules for broader compatibility)
61+
- **Tests**: CommonJS require/module.exports (Bun supports both)
62+
- **Minimal package.json**: Basic metadata only, no external dependencies
6363

6464
## Bang System
6565

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ check: # Check formatting and linting with Biome
2323
@echo "Checking formatting and linting.."
2424
npx --yes @biomejs/biome check .
2525

26-
test: # Run unit tests with Jest
26+
test: # Run unit tests with Bun
2727
@echo "Running tests.."
28-
bunx jest -c '{"testMatch":["**/tests/**/*.spec.js"]}'
28+
bun test
2929

3030
# -----------------------------------------------------------
3131
# CAUTION: If you have a file with the same name as make

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ make check # Run formatting and linting checks
100100
```
101101

102102
**Development Requirements:**
103-
- [Bun](https://bun.sh/) - Fast package manager and test runner (for Jest execution)
103+
- [Bun](https://bun.sh/) - Fast test runner and package manager
104104
- Python 3 - Development server via `python -m http.server`
105105

106106
No build process or external dependencies required for the core application.

0 commit comments

Comments
 (0)