Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try use screenshots with Typescript #1112

Merged
merged 16 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ build
types
examples/assets/prism.js
examples/build/
!/test-results/
31 changes: 31 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Playwright Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: npm ci
- name: Build
run: make build es=es2021 fat=true uglify=true
- name: Install Playwright Browsers
run: make screenshots-build-image
- name: Run Playwright tests
run: make screenshots-test es=es2021 fat=true min=true updateTests=true
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
34 changes: 0 additions & 34 deletions .github/workflows/screenshot.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ yarn-error.log
build/*
examples/build/
.env
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
23 changes: 17 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ BUILD_ESM := true
UGLIFY_ESM := false
CHANGELOG_URL := https://github.com/xdan/jodit/blob/main/CHANGELOG.md
NODE_MODULES_BIN := ./node_modules/.bin
TS_NODE_BASE := $(NODE_MODULES_BIN)/ts-node --project $(cwd)tools/tsconfig.json
TS_NODE_BASE := $(NODE_MODULES_BIN)/ts-node --project ./tools/tsconfig.json
WEBPACK := $(TS_NODE_BASE) $(NODE_MODULES_BIN)/webpack
KARMA := @TS_NODE_TRANSPILE_ONLY=true $(TS_NODE_BASE) $(NODE_MODULES_BIN)/karma start
MOCHA := $(TS_NODE_BASE) $(NODE_MODULES_BIN)/mocha

.PHONY: update
update:
Expand Down Expand Up @@ -230,16 +231,26 @@ screenshots-all:

.PHONY: screenshots-test
screenshots-test:
docker run -v $(shell pwd)/build:/app/build/ -v $(shell pwd)/test:/app/test/ \
-p 2003:2003 \
-e SNAPSHOT_UPDATE=$(updateTests) \
-v $(shell pwd)/src:/app/src/ jodit-screenshots \
node --input-type=module ./node_modules/.bin/mocha ./src/**/**.screenshot.js --build=$(es) --min=$(uglify) --fat=$(fat)
docker run --ipc=host \
-p 9323:9323 \
-v $(shell pwd)/build:/app/build/ \
-v $(shell pwd)/test:/app/test/ \
-v $(shell pwd)/src:/app/src/ \
-v $(shell pwd)/tools:/app/tools/ \
-v $(shell pwd)/tools:/app/tools/ \
-v $(shell pwd)/playwright-report:/app/playwright-report/ \
-v $(shell pwd)/playwright.config.ts:/app/playwright.config.ts \
-e BUILD=$(es) \
-e MIN=$(uglify) \
-e FAT=$(fat) \
jodit-screenshots \
npx playwright test # --update-snapshots

.PHONY: screenshots-build-image
screenshots-build-image:
docker build -t jodit-screenshots -f test/screenshots/Dockerfile .


.PHONY: newversion
newversion:
npm version patch --no-git-tag-version
Expand Down
Loading
Loading