Jest + Playwright Testing by jhildenbiddle · Pull Request #1276 · docsifyjs/docsify

added 15 commits

July 7, 2020 06:31

@jhildenbiddle

- Setup projects for e2e, integration, and unit tests in Jest configuration
- Setup /tests/e2e/ tests for Jest+PlayWright
- Setup /tests/integration/ tests for Jest
- Setup /tests/unit/ tests for Jest
- Setup eslint for Jest and Jest+Playwright environments
- Move e2e configuration files into separate folder
- Update e2e example tests
- Update unit example tests
- Update HTML fixtures
- Add `debug` option
- Append `Markdown` suffix to markdown-related options
- Reorder options alphabetically

@jhildenbiddle

@jhildenbiddle

@jhildenbiddle

…2e only)

- Create identical docsifyInit() tests using Jest (integration) and Playwright (e2e)
- Update docsifyInit() to convert relative URLs to absolute URLs to work in both JSDOM and Playwright
- Update docsifyInit() to append style- and js-related tags using createElement instead of insertAdjacentHTML
- Update paths in test files to use unified docsifyInit()
- Added option to docsifyInit() to enable/disable formatted HTML output to console
- Removed vue.css as default docsify theme from docsifyInit()
- Removed outdated files

@jhildenbiddle

@jhildenbiddle

- Allows mocking all XMLHttpRequests instead of just those initiated via /src/core/fetch/ajax.js
- Allows JSDOM tests to use /lib/docsify.js instead of /src/core/index.js (same as Playwright tests)
- Allows JSDOM tests to use /docs site as test content

@jhildenbiddle

- Import globals from various files instead of manually adding them to ensure they are availability in Jest and eslint configurations
- Add middleware to server configuration for serving virtual “_blank.html” file
- Add BLANK_URL
- Rename TEST_URL to TEST_HOST
- Removed ./test/fixtures/ directory (blank page now served via server.js middleware)
- Added page.goto(BLANK_URL) call to global Playwright beforeEach() setup

@jhildenbiddle

@jhildenbiddle

@jhildenbiddle

@jhildenbiddle

@jhildenbiddle

anikethsaha

@jhildenbiddle

- Relocate carbon plugin script with other scripts
- Update zh-cn docs URL to align with other translatins (GitHub, not jsdelivr)
- Add major version locks to URLs

@jhildenbiddle

@jhildenbiddle

@jhildenbiddle

# Conflicts:
#	cypress/fixtures/tpl/docs.index.html
#	docs/index.html
#	package-lock.json
#	test/unit/render.test.js

@jhildenbiddle

@jhildenbiddle