Skip to content

Commit

Permalink
Merge pull request #163 from LuanRoger/feat/vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanRoger authored Feb 1, 2025
2 parents 2633ab2 + 092e021 commit 0e47f4d
Show file tree
Hide file tree
Showing 10 changed files with 1,240 additions and 3,546 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/playwright.yml → .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,40 @@
name: Playwright Tests
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
timeout-minutes: 60
tests-unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm run test:unit

test-e2e:
timeout-minutes: 10
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Create Executable
run: npm run make
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v3
run: npm run test:e2e
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ To develop a Electron app, you probably will need some UI, test, formatter, styl

### Test 🧪

- [Jest](https://jestjs.io)
- [Vitest](https://vitest.dev)
- [Playwright](https://playwright.dev)
- [React Testing Library](https://testing-library.com/docs/react-testing-library/intro)

Expand Down Expand Up @@ -88,7 +88,7 @@ To develop a Electron app, you probably will need some UI, test, formatter, styl
- `lib/`: Store libraries and other utilities
- `pages/`: Store app's pages
- `style/`: Store global styles
- `tests/`: Store tests (from Jest and Playwright)
- `tests/`: Store tests (from Vitest and Playwright)

## NPM script

Expand All @@ -105,11 +105,11 @@ npm run <script>
- `lint`: Run ESLint to lint the code
- `format`: Run Prettier to check the code (it doesn't change the code)
- `format:write`: Run Prettier to format the code
- `test`: Run the default unit-test script (Jest)
- `test:watch`: Run the default unit-test script in watch mode (Jest)
- `test:unit`: Run the Jest tests
- `test`: Run the default unit-test script (Vitest)
- `test:watch`: Run the default unit-test script in watch mode (Vitest)
- `test:unit`: Run the Vitest tests
- `test:e2e`: Run the Playwright tests
- `test:all`: Run all tests (Jest and Playwright)
- `test:all`: Run all tests (Vitest and Playwright)

> The test scripts involving Playwright require the app be builded before running the tests. So, before run the tests, run the `package`, `make` or `publish` script.
Expand Down
20 changes: 0 additions & 20 deletions jest.config.ts

This file was deleted.

1 change: 0 additions & 1 deletion jest.setup.ts

This file was deleted.

Loading

0 comments on commit 0e47f4d

Please sign in to comment.