-
Notifications
You must be signed in to change notification settings - Fork 10
docs: add typescript & angular usage section #10
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,8 @@ yarn add --dev @testing-library/jasmine-dom | |
|
||
## Usage | ||
|
||
### With JavaScript | ||
|
||
You should have a directory for helpers specified inside the helpers array in your `jasmine.json` file. | ||
Example: | ||
|
||
|
@@ -122,7 +124,19 @@ beforeAll(() => { | |
}); | ||
``` | ||
|
||
That's it! You're good to go. | ||
### With Karma and TypeScript in an Angular project | ||
|
||
Add to the existing `types` array in `tsconfig.spec.json`: `"@testing-library/jasmine-dom"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add Example:
|
||
|
||
In your tests setup file, import jasmine-dom like so: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In your tests setup file ( |
||
|
||
```typescript | ||
import JasmineDOM from '@testing-library/jasmine-dom/dist'; | ||
|
||
beforeAll(() => { | ||
jasmine.getEnv().addMatchers(JasmineDOM); | ||
}); | ||
``` | ||
|
||
## Matchers | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
To match the title above this should be 'With TypeScript'.
Maybe add (eg. Angular)?nah, I think the difference is really the language...