Skip to content

Commit

Permalink
feat: @testing-library/react based tests (#206)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonas Hungershausen <[email protected]>
  • Loading branch information
mszekiel and jonas-jonas authored Sep 6, 2024
1 parent 6b1a8fd commit 04110fc
Show file tree
Hide file tree
Showing 18 changed files with 6,500 additions and 1,884 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
branches: [main, jonas-jonas/elementsv1]
jobs:
pull_request:
timeout-minutes: 20
Expand All @@ -21,7 +21,7 @@ jobs:
- run: npx playwright install --with-deps
# Re-enable, once we don't have weird depdenency issues, because of the shared src/ folder
# - run: npx nx affected -t lint test build
- run: npx nx run-many --all -t lint test build
- run: npx nx run-many --all -t lint test build --verbose
- uses: actions/upload-artifact@v2
if: always()
with:
Expand Down Expand Up @@ -49,3 +49,9 @@ jobs:
- uses: chromaui/[email protected]
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitOnceUploaded: true

- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ pnpm-lock.yaml
/playwright-report/
/playwright/.cache/
.nx
coverage/
194 changes: 0 additions & 194 deletions jest.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright © 2024 Ory Corp
// SPDX-License-Identifier: Apache-2.0

import { getJestProjects } from "@nx/jest"
import { getJestProjects, getJestProjectsAsync } from "@nx/jest"

export default {
projects: [...getJestProjects(), "<rootDir>/jest.config.ts"],
projects: await getJestProjects(),
}
8 changes: 8 additions & 0 deletions jest.preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright © 2024 Ory Corp
// SPDX-License-Identifier: Apache-2.0

const nxPreset = require("@nx/jest/preset").default

module.exports = {
...nxPreset,
}
6 changes: 6 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@
"options": {
"targetName": "eslint:lint"
}
},
{
"plugin": "@nx/jest/plugin",
"options": {
"targetName": "test"
}
}
]
}
Loading

0 comments on commit 04110fc

Please sign in to comment.