mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
* Add try/catch w/ error message to plugin calls * Update lifecycle.js * Update lifecycle.js * Fix docsify-plugin-carbon error * Fix ESLint errors * Simplify conditional JS loading * Fix styles in legacy browser w/o CSS var support * Fix gitignore paths * Fix BrowserSync IE error * Fix search field presentation in IE11 - Removed fixed height and allow element to size naturally via font-size and padding - Remove default "x" rendered on IE input fields * Revert "Update lifecycle.js" This reverts commit 2a58be69eb75a87b74d0408765e1d222282ac95b. * Revert "Update lifecycle.js" This reverts commit 67c5410b049237887811350f38e3f9bc8a2c78dc. * Revert "Add try/catch w/ error message to plugin calls" This reverts commit 631e9248786f87a5b2f7892fc73a53543744d288. * Fix docsify-plugin-carbon error & ESLint errors Co-authored-by: 沈唁 <52o@qq52o.cn>
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
process.env.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