mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
* develop: (104 commits) chore: bump ssri from 6.0.1 to 6.0.2 (#1563) chore: Update Edit Document using develop branch (#1541) fix: Add escapeHtml for search (#1551) docs: link with plugin Pagination (#1554) fix: Upgrade dompurify from 2.2.6 to 2.2.7 (#1553) fix: upgrade dompurify from 2.2.6 to 2.2.7 (#1552) chore: bump y18n from 4.0.0 to 4.0.1 (#1548) chore: Fix search for missing pathNamespaces (#1547) fix: Upgrade docsify from 4.12.0 to 4.12.1 (#1544) docs:Update deploy, change Zeit to Vercel (#1540) fix: Cannot read property 'classList' of null (#1527) chore: fix microsoft/playwright-github-action error (#1534) Update PULL_REQUEST_TEMPLATE.md chore: Update CHANGELOG and Update test snapshots chore: add changelog 4.12.1 [build] 4.12.1 feat: Support search when there is no title (#1519) test(unit): add test cases on isExternal. (#1515) docs: Update Vercel logo link (#1520) fix: Upgrade docsify from 4.11.6 to 4.12.0 (#1518) ...
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.
- Jest-Playwright: A Jest preset that simplifies using Jest and Playwright together
Test files
- E2E tests are located in
/test/e2e/and use Jest + Playwright. - Integration tests are located in
/test/integration/and use Jest. - Unit tests located in
/test/unit/and use Jest.
Global Variables
TEST_HOST: Test server ip:port
CLI commands
# Run all tests
npm run test
# Run test types
npm run test:e2e
npm run test:integration
npm run test:unit
# Run test file
npm run test -- -i /path/to/file.test.js
# Run matching test files
npm run test -- -i /path/to/*.test.js
# Run matching test name(s)
npm run test -- -t \"describe() or test() name\"
# Run matching test name(s) in file
npm run test -- -i /path/to/file.test.js -t \"describe() or test() name\"
# Run all example tests
npm run test -- -i /test/**/example.test.js
# Run specific example test file
npm run test -- -i /path/to/example.test.js
# ------------------------------------------------------------------------------
# Update snapshots for matching test files
npm run test -- -u -i /path/to/*.test.js
# Update snapshots for matching test name(s)
npm run test -- -u -t \"describe() or test() name\"
# Update snapshots for matching test name(s) in file
npm run test -- -u -i /path/to/file.test.js -t \"describe() or test() name\"
# ------------------------------------------------------------------------------
# Start manual test server instance. Useful for previewing test fixtures.
# Root: /test/e2e/fixtures/
# Routes: /docs, /lib,
node ./test/config/server.js --start