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 committed Oct 16, 2024
1 parent e6d0d75 commit 9c4d59d
Show file tree
Hide file tree
Showing 17 changed files with 5,087 additions and 1,965 deletions.
12 changes: 10 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 @@ -19,7 +19,9 @@ jobs:
run: npm ci
- uses: nrwl/nx-set-shas@v4
- run: npx playwright install --with-deps
- run: npx nx affected -t lint test build
# 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 --verbose
- uses: actions/upload-artifact@v2
if: always()
with:
Expand Down Expand Up @@ -47,3 +49,9 @@ jobs:
- uses: chromaui/action@v11
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitOnceUploaded: true

- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
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,
}
16 changes: 15 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,19 @@
},
"affected": {
"defaultBase": "main"
}
},
"plugins": [
{
"plugin": "@nx/eslint/plugin",
"options": {
"targetName": "eslint:lint"
}
},
{
"plugin": "@nx/jest/plugin",
"options": {
"targetName": "test"
}
}
]
}
Loading

0 comments on commit 9c4d59d

Please sign in to comment.