-
Notifications
You must be signed in to change notification settings - Fork 0
Add tests #1
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
Conversation
| "@solidjs/testing-library": "^0.8.10", | ||
| "@testing-library/jest-dom": "^6.6.3", | ||
| "@testing-library/user-event": "^14.6.1", | ||
| "jsdom": "^26.0.0", |
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.
add deps
|
|
||
| <ItemGroup> | ||
| <Compile Include="App.fs" /> | ||
| <Compile Include="App.test.fs" /> |
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.
add test file
|
|
||
| [<Import("fireEvent", from = "@solidjs/testing-library")>] | ||
| let fireEvent: DomEvent = jsNative | ||
|
|
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.
Dom (TestingLibrary) fable bindings
| let test(name: string, test: unit -> unit) = jsNative | ||
|
|
||
| [<Import("describe", from = "vitest")>] | ||
| let describe(name: string, testSuite: unit -> unit) = jsNative |
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.
Vi (vitest) fable bindings
| Dom.fireEvent.click(buttonElement) | ||
| let updatedButtonElement = element.getByText("count is 1") | ||
| Vi.expect(updatedButtonElement).toBeInTheDocument() | ||
| ) |
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.
actual test
| conditions: ["development", "browser"], | ||
| test: { | ||
| server: { | ||
| deps: { inline: true } |
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.
requitred for this to work in vscode ext
adds
npm run testsupport with vitest, and VI and TestingLibrary (dom) custom bindings