Skip to content

Commit

Permalink
Merge pull request #8 from deinsoftware/dev
Browse files Browse the repository at this point in the history
added toBeInTheDocument assertion
  • Loading branch information
equiman authored Apr 1, 2023
2 parents 743212b + a9f85f5 commit 3033537
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"tbct",
"tbgt",
"tbgte",
"tbid",
"tblt",
"tblte",
"thbc",
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Fixed for any bug fixes.
Security to invite users to upgrade in case of vulnerabilities.
-->

## 1.4.0 - 2023/03/31

### Added

- `toBeInTheDocument` assertion

## 1.3.0 - 2023/03/31

### Added
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,21 @@ Below is a list of all available snippets and the triggers of each one. The `░
| --------: | ------------------------------------------------------------------------------------------- |
| `tb→` | `expect(░).toBe(░)█` |
| `tbct→` | `expect(░).toBeCloseTo(░number, ░delta)█` |
| `tbd→` | `expect(░).toBeDefined()█` |
| `tbf→` | `expect(░).toBeFalsy()█` |
| `tbd→` | `expect(░).toBeDefined()█` |
| `tbf→` | `expect(░).toBeFalsy()█` |
| `tbgt→` | `expect(░).toBeGreaterThan(░)█` |
| `tbgte→` | `expect(░).toBeGreaterThanOrEqual(░)█` |
| `tbid→` | `expect(░).toBeInTheDocument()█` |
| `tbi→` | `expect(░).toBeInstanceOf(░)█` |
| `tblt→` | `expect(░).toBeLessThan(░)█` |
| `tblte→` | `expect(░).toBeLessThanOrEqual(░)█` |
| `tbn→` | `expect(░).toBeNull()█` |
| `tbt→` | `expect(░).toBeTruthy()█` |
| `tbu→` | `expect(░).toBeUndefined()█` |
| `tbn→` | `expect(░).toBeNull()█` |
| `tbt→` | `expect(░).toBeTruthy()█` |
| `tbu→` | `expect(░).toBeUndefined()█` |
| `tc→` | `expect(░list).toContain(░)█` |
| `tce→` | `expect(░list).toContainEqual(░)█` |
| `te→` | `expect(░).toEqual(░)█` |
| `thbc→` | `expect(░).toHaveBeenCalled()█` |
| `thbc→` | `expect(░).toHaveBeenCalled()█` |
| `thbct→` | `expect(░).toHaveBeenCalledTimes(░)█` |
| `thbcw→` | `expect(░).toHaveBeenCalledWith(░)█` |
| `thblcw→` | `expect(░).toHaveBeenLastCalledWith(░)█` |
Expand All @@ -178,8 +179,8 @@ Below is a list of all available snippets and the triggers of each one. The `░
| `tse→` | `expect(░).toStrictEqual(░)█` |
| `tt→` | <code>expect(() => {<br/>&nbsp;&nbsp;█<br/>}).toThrow(░)</code> |
| `tte→` | <code>expect(() => {<br/>&nbsp;&nbsp;█<br/>}).toThrowError(░)</code> |
| `ttemis→` | <code>expect(() => {<br/>&nbsp;&nbsp;█<br/>}).toThrowErrorMatchingInlineSnapshot()</code> |
| `ttems→` | <code>expect(() => {<br/>&nbsp;&nbsp;█<br/>}).toThrowErrorMatchingSnapshot()</code> |
| `ttemis→` | <code>expect(() => {<br/>&nbsp;&nbsp;█<br/>}).toThrowErrorMatchingInlineSnapshot()</code> |
| `ttems→` | <code>expect(() => {<br/>&nbsp;&nbsp;█<br/>}).toThrowErrorMatchingSnapshot()</code> |

[Back to menu](#menu)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vitest-snippets",
"description": "VS Code Vitest snippets for JS and TS",
"version": "1.3.0",
"version": "1.4.0",
"displayName": "Vitest Snippets",
"publisher": "deinsoftware",
"icon": "images/light-icon.png",
Expand Down
5 changes: 5 additions & 0 deletions snippets/assertion.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
"body": "expect($1).toBeGreaterThanOrEqual($2)$0",
"description": "expects the argument is greater than"
},
"toBeInTheDocument": {
"prefix": "tbid",
"body": "expect($1).toBeInTheDocument()$0",
"description": "expects the argument to be in the document"
},
"toBeInstanceOf": {
"prefix": "tbi",
"body": "expect($1).toBeInstanceOf($2)$0",
Expand Down

0 comments on commit 3033537

Please sign in to comment.