-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: fe test setup #12
Conversation
da14d7c
to
7cb3f21
Compare
ea99620
to
a3bf360
Compare
vi.mock("../../../api/api-client"); | ||
vi.mock("@remix-run/react", async () => { | ||
const module = | ||
await vi.importActual<typeof import("@remix-run/react")>( | ||
"@remix-run/react" | ||
); | ||
return { | ||
...module, | ||
useNavigate: () => mockedUseNavigate, | ||
Link: ({ to, children }: PropsWithChildren<{ to: string }>) => ( | ||
<a href={to}>{children}</a> | ||
), | ||
}; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move it to some method that we just fire in all the tests?
ApiClient.auth.authControllerLogin.mockResolvedValue({ | ||
data: "", | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can have mock service worker running with the tests which would act as better mock solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think i'd keep the seed near the top of the api like in src
folder - also we can explore if we want to break it down into smaller pieces like seedAdmin(), seedUsers(), seedFiles() wdyt @mikoscz ?
document.documentElement.classList.remove("dark"); | ||
}) | ||
.exhaustive(); | ||
if (typeof document !== "undefined") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where document is not present?
"lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .", | ||
"start": "cross-env NODE_ENV=production node ./server.js", | ||
"generate:client": "swagger-typescript-api -p ../api/src/swagger/api-schema.json -o ./app/api --axios --name generated-api.ts --api-class-name API", | ||
"typecheck": "tsc" | ||
"typecheck": "tsc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"typecheck": "tsc", | |
"tsc": "tsc --noEmit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also you can add tsc-lint : tsc --noEmit && eslint command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep the tests next to components - without tests folder
a35c4be
to
fb064f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fe ✅
No description provided.