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

Tiles 5081 tests #35

Merged
merged 7 commits into from
May 23, 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
14 changes: 14 additions & 0 deletions .github/workflows/prettier-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Prettier check

on: push

jobs:
prettier-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm run prettier
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test deck2gisLayer plugin

on:
push:
branches:
- '*'
tags-ignore:
- '*'

jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm run test:screenshots
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
path: test/screenshots/__screenshots__/**/__diff_output__/*.png
retention-days: 5
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Deck2gisLayer uses github-flow to accept & merge fixes and improvements. Basic p
- Fork the repo.
- Create a branch.
- Add or fix some code.
- **Run testing suite with `npm run docker:test` and make sure nothing is broken**
- **Run testing suite with `npm run test:screenshots` and make sure nothing is broken**
- Add some tests for your new code or fix broken tests.
- Commit & push.
- Create a new pull request to original repo.
Expand All @@ -58,12 +58,7 @@ Also, if you modify packages or add them to `package.json`, make sure you use `n

### Run tests
```shell
npm run docker:test
```

### Update screenshots
```shell
npm run docker:screenshot:update
npm run test:screenshots
```

## Release
Expand Down
27 changes: 27 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const suite = process.env.TEST_SUITE || 'screenshots';

const suiteParams = {
screenshots: {
globalSetup: './test/global-setup.js',
globalTeardown: './test/global-teardown.js',
maxWorkers: 5,
maxConcurrency: 3,
testTimeout: 50000,
testEnvironment: 'node',
testMatch: ['**/test/screenshots/**/*.ts'],
},
};

module.exports = {
preset: 'ts-jest',
globals: {
'ts-jest': {
diagnostics: {
// Игнорируем воргинги про esModuleInterop, которые нам чинить, кажется не требуется
// потому что в тестах импорты работают без проблем.
ignoreCodes: [151001],
},
},
},
...suiteParams[suite],
};
Loading
Loading