Skip to content

Commit

Permalink
Merge pull request #1112 from xdan/screenshots-typescript
Browse files Browse the repository at this point in the history
Try use screenshots with Typescript
  • Loading branch information
xdan authored Apr 21, 2024
2 parents 03fc935 + ab745b3 commit 63815f9
Show file tree
Hide file tree
Showing 138 changed files with 979 additions and 11,741 deletions.
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

0 comments on commit 63815f9

Please sign in to comment.