Skip to content

Commit c085991

Browse files
authored
Merge pull request #2 from deinsoftware/dev
add debug snippets
2 parents 6168845 + 3c537f1 commit c085991

File tree

6 files changed

+56
-8
lines changed

6 files changed

+56
-8
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"itrh",
1515
"itue",
1616
"paypal",
17+
"sltp",
1718
"volta"
1819
],
1920
"markdownlint.config": {

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ Fixed for any bug fixes.
99
Security to invite users to upgrade in case of vulnerabilities.
1010
-->
1111

12+
## 0.0.3 - 2023/04/05
13+
14+
### Added
15+
16+
- debug snippets
17+
1218
## 0.0.2 - 2023/04/05
1319

1420
### Added

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ Below is a list of all available snippets and the triggers of each one. The `░
7373

7474
### Import
7575

76-
| Trigger | Result |
77-
| -------: | ----------------------------------------------------------------- |
78-
| `itl→` | `import { render, screen } from '@testing-library/░<react\|vue>'█` |
79-
| `itr→` | `import { render, screen } from '@testing-library/react'█` |
80-
| `itv→` | `import { render, screen } from '@testing-library/vue'█` |
81-
| `itrh→` | `import { renderHook } from '@testing-library/react'█` |
82-
| `itue→` | `import user from '@testing-library/user-event'█` |
76+
| Trigger | Result |
77+
| -------: | ------------------------------------------------------------------- |
78+
| `itl→` | `import { render, screen } from '@testing-library/░<react\|vue>'█` |
79+
| `itr→` | `import { render, screen } from '@testing-library/react'█` |
80+
| `itv→` | `import { render, screen } from '@testing-library/vue'█` |
81+
| `itrh→` | `import { renderHook } from '@testing-library/react'█` |
82+
| `itue→` | `import user from '@testing-library/user-event'█` |
8383

8484
### User Event
8585

@@ -100,6 +100,13 @@ Below is a list of all available snippets and the triggers of each one. The `░
100100
| `gabr→` | `screen.getAllByRole('░id')█` |
101101
| `gabro→` | `screen.getAllByRole('░id', {░})█` |
102102

103+
### Debug
104+
105+
| Trigger | Result |
106+
| -------: | ------------------------------------ |
107+
| `sd→` | `screen.debug()█` |
108+
| `sltp→` | `screen.logTestingPlaygroundURL()█` |
109+
103110
[Back to menu](#menu)
104111

105112
---

package.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "testing-library-snippets",
33
"description": "VS Code Testing Library snippets for JS and TS",
4-
"version": "0.0.2",
4+
"version": "0.0.3",
55
"displayName": "Testing Library Snippets",
66
"publisher": "deinsoftware",
77
"icon": "images/light-icon.png",
@@ -54,6 +54,10 @@
5454
"language": "javascript",
5555
"path": "./snippets/queries.json"
5656
},
57+
{
58+
"language": "javascript",
59+
"path": "./snippets/debug.json"
60+
},
5761
{
5862
"language": "javascriptreact",
5963
"path": "./snippets/import.json"
@@ -66,6 +70,10 @@
6670
"language": "javascriptreact",
6771
"path": "./snippets/queries.json"
6872
},
73+
{
74+
"language": "javascriptreact",
75+
"path": "./snippets/debug.json"
76+
},
6977
{
7078
"language": "vue",
7179
"path": "./snippets/import.json"
@@ -78,6 +86,10 @@
7886
"language": "vue",
7987
"path": "./snippets/queries.json"
8088
},
89+
{
90+
"language": "vue",
91+
"path": "./snippets/debug.json"
92+
},
8193
{
8294
"language": "typescript",
8395
"path": "./snippets/import.json"
@@ -90,6 +102,10 @@
90102
"language": "typescript",
91103
"path": "./snippets/queries.json"
92104
},
105+
{
106+
"language": "typescript",
107+
"path": "./snippets/debug.json"
108+
},
93109
{
94110
"language": "typescriptreact",
95111
"path": "./snippets/import.json"
@@ -101,6 +117,10 @@
101117
{
102118
"language": "typescriptreact",
103119
"path": "./snippets/queries.json"
120+
},
121+
{
122+
"language": "typescriptreact",
123+
"path": "./snippets/debug.json"
104124
}
105125
]
106126
},

snippets/debug.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"screen.debug": {
3+
"prefix": "sd",
4+
"body": "screen.debug()$0",
5+
"description": "screen debug"
6+
},
7+
"screen.log.testing-playground": {
8+
"prefix": "sltp",
9+
"body": "screen.logTestingPlaygroundURL()$0",
10+
"description": "screen log testing playground url"
11+
}
12+
}

test/snippets.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import { it, expect, describe } from 'vitest'
33
const importSnippets = require("../snippets/import.json")
44
const userEventSnippets = require("../snippets/user-event.json")
55
const queriesSnippets = require("../snippets/queries.json")
6+
const debugSnippets = require("../snippets/debug.json")
67

78
const snippets = {
89
...importSnippets,
910
...userEventSnippets,
1011
...queriesSnippets,
12+
...debugSnippets,
1113
}
1214

1315
const unique = (xs) => [...new Set(xs)]

0 commit comments

Comments
 (0)