1.8 KiB
1.8 KiB
Jasmine Core Development Notes
Architecture
- This is the main jasmine-core repository, a JavaScript BDD testing framework
- Directory structure:
src/- source codesrc/core/- environment-agnostic core functionalitysrc/html/- browser-specific codesrc/boot/- boot files for browser setup
spec/- tests, mirrors the src directory structurelib/- compiled distribution files (built, not checked in modified)
Key Development Commands
npm install- install dependenciesnpm test- run all tests in Node.js + lint + prettier checknpm run test:parallel- run tests in parallelnpm run build- build distribution to/libnpm run cleanup- auto-fix prettier errorsnpm run serve- serve tests for browser testing at http://localhost:8888JASMINE_BROWSER=<name> npm run ci- run browser tests via Selenium
Before submitting PR
- Run tests in Node.js AND browsers:
npm testandnpm run serve - Fix any eslint/prettier errors:
npm run cleanup - Build
lib/withnpm run buildand re-test - Revert changes to built files in
lib/- maintainers will rebuild when merging
Testing Conventions
- Jasmine self-tests:
lib/jasmine-core.jsprovidesjasmine(runner),src/providesjasmineUnderTest(code under test) - Always use
jasmineUnderTestfor objects/functions being tested
Coding Conventions
- Single quotes, semicolons required
- Curly braces required for all control statements
- ECMA 2022 syntax, commonjs modules
- Core code must stay environment-agnostic:
- Keep browser-specific code in
src/html/ - Degrade gracefully when environment-specific features aren't available
- Keep browser-specific code in
Supported Environments
- Node: 20, 22, 24
- Browsers: Safari 26+, Chrome/Firefox/Edge (evergreen)