-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from Bricks666/feature/36-add-integration-and-…
…unit-tests Feature/36 add integration and unit tests
- Loading branch information
Showing
278 changed files
with
27,867 additions
and
4,914 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
BASE_CLIENT_URL=http://localhost:3000 | ||
API_HOST=http://localhost:5000/api | ||
VITE_API_HOST=http://localhost:3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
BASE_CLIENT_URL=http://localhost:3000 | ||
API_HOST=http://localhost:5000/api | ||
VITE_API_HOST=http://localhost:3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: 'Run tests' | ||
|
||
on: | ||
push: | ||
branches: ['main', 'develop'] | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Checkout branch | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
cache: 'npm' | ||
|
||
- name: Install deps | ||
run: npm ci | ||
|
||
- name: Run tests | ||
run: npm run test:coverage | ||
|
||
- name: "Report Coverage" | ||
if: always() | ||
uses: davelosert/vitest-coverage-report-action@v2 | ||
with: | ||
json-summary-path: coverage/coverage-summary.json | ||
json-final-path: coverage/coverage-final.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"src/**/*.tsx": { "alternate": "src/{}.spec.tsx" }, | ||
"src/**/*.ts": { "alternate": "src/{}.spec.ts" } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"extends": ["stylelint-config-clean-order"], | ||
"plugins": [ | ||
"stylelint-color-format", | ||
"stylelint-use-nesting", | ||
"stylelint-z-index-value-constraint", | ||
"stylelint-no-nested-media", | ||
"stylelint-high-performance-animation", | ||
"stylelint-css-modules" | ||
], | ||
"rules": { | ||
"color-format/format": { | ||
"format": "hsl" | ||
}, | ||
"media-feature-range-notation": "prefix", | ||
|
||
"plugin/z-index-value-constraint": { | ||
"min": -1, | ||
"max": 10000 | ||
}, | ||
|
||
"pitcher/no-nested-media": true, | ||
|
||
"plugin/no-low-performance-animation-properties": true | ||
}, | ||
"ignoreFiles": ["**/*.[jt]sx?", "**/third-party/*", "**/PlanEditor/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const setup = () => { | ||
process.env.TZ = 'UTC'; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { expect, afterEach, beforeAll, afterAll, vi } from 'vitest'; | ||
import { cleanup } from '@testing-library/react'; | ||
import * as matchers from '@testing-library/jest-dom/matchers'; | ||
import { | ||
matchMedia, | ||
MediaQueryListEvent, | ||
cleanup as cleanupMatchMedia, | ||
} from 'mock-match-media'; | ||
import { server } from '~/test-utils'; | ||
|
||
expect.extend(matchers); | ||
|
||
vi.mock('@/shared/configs/i18n/index.ts'); | ||
|
||
vi.mock('@farfetched/core', async (importOriginal) => { | ||
const module = await importOriginal<typeof import('@farfetched/core')>(); | ||
|
||
return { | ||
...module, | ||
keepFresh: vi.fn(), | ||
}; | ||
}); | ||
|
||
beforeAll(() => { | ||
server.listen(); | ||
}); | ||
|
||
afterEach(() => { | ||
cleanup(); | ||
server.resetHandlers(); | ||
cleanupMatchMedia(); | ||
}); | ||
|
||
afterAll(() => { | ||
server.close(); | ||
}); | ||
|
||
window.MediaQueryListEvent = MediaQueryListEvent; | ||
window.matchMedia = matchMedia; |
Oops, something went wrong.