mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
* Update JS build - Change rollup build from API to config file - Change output dir from lib to dist - Update lib to dist path in related files - Update dependencies - Add banner comment to bundles - Add unminified plugin bundles * Update docs with v5 version lock and dist path * Update docs to reference minified themes * Clean up docs * Update CSS build - Change CSS build from API to CLI - Change output dir from lib to dist - Update lib to dist path in related files - Update dependencies - Add sourcemaps * Update dependencies * Clean up package.json and add keywords * Fix rimraf globs on Windows * Fix PostCSS CLI glob on Windows * Update test-related dependencies * Update emoji * Add engines prop to package.json
Docsify Testing
Environment
- Jest: A test framework used for assertions, mocks, spies, etc.
- Playwright: A test automation tool for launching browsers and manipulating the DOM.
Test files
- Unit tests located in
/test/unit/and use Jest. - Integration tests are located in
/test/integration/and use Jest. - E2E tests are located in
/test/e2e/and use Jest + Playwright.
CLI commands
# Run all tests
npm t
# Run test types
npm run test:e2e
npm run test:integration
npm run test:unit
Unit / Integration (Jest)
# Run test file(s)
npm run test:unit -- -i ./path/to/file.test.js
npm run test:unit -- -i ./path/to/*.test.js
# Run test name(s)
npm run test:unit -- -t "my test"
# Run test name(s) in file
npm run test:unit -- -i ./path/to/file.test.js -t "my test"
# ------------------------------------------------------------------------------
# Update snapshots
npm run test:unit -- -u
# Update snapshots for test file(s)
npm run test:unit -- -u -i ./path/to/file.test.js
npm run test:unit -- -u -i ./path/to/*.test.js
# Update snapshots for test name(s)
npm run test:unit -- -u -t "my test"
# Update snapshots for test name(s) in file
npm run test:unit -- -u -i ./path/to/file.test.js -t "my test"
E2E (Playwright)
# Run test file(s)
npm run test:e2e -- ./path/to/file.test.js
npm run test:e2e -- ./path/to/*.test.js
# Run test name(s)
npm run test:e2e -- -g "my test"
# Run test name(s) in file
npm run test:e2e -- ./path/to/file.test.js -g "my test"
# ------------------------------------------------------------------------------
# Update snapshots
npm run test:e2e -- -u
# Update snapshots for test file(s)
npm run test:e2e -- -u ./path/to/file.test.js
npm run test:e2e -- -u ./path/to/*.test.js
# Update snapshots for test name(s)
npm run test:e2e -- -u -g "my test"
# Update snapshots for test name(s) in file
npm run test:e2e -- -u ./path/to/file.test.js -g "my test"