diff --git a/.vscode/settings.json b/.vscode/settings.json index b4f7244..c865fd0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,6 +14,7 @@ "itrh", "itue", "paypal", + "sltp", "volta" ], "markdownlint.config": { diff --git a/CHANGELOG.md b/CHANGELOG.md index d9eb4ba..1c789ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ Fixed for any bug fixes. Security to invite users to upgrade in case of vulnerabilities. --> +## 0.0.3 - 2023/04/05 + +### Added + +- debug snippets + ## 0.0.2 - 2023/04/05 ### Added diff --git a/README.md b/README.md index 9ecb640..168cee3 100644 --- a/README.md +++ b/README.md @@ -73,13 +73,13 @@ Below is a list of all available snippets and the triggers of each one. The `░ ### Import -| Trigger | Result | -| -------: | ----------------------------------------------------------------- | -| `itl→` | `import { render, screen } from '@testing-library/░'█` | -| `itr→` | `import { render, screen } from '@testing-library/react'█` | -| `itv→` | `import { render, screen } from '@testing-library/vue'█` | -| `itrh→` | `import { renderHook } from '@testing-library/react'█` | -| `itue→` | `import user from '@testing-library/user-event'█` | +| Trigger | Result | +| -------: | ------------------------------------------------------------------- | +| `itl→` | `import { render, screen } from '@testing-library/░'█` | +| `itr→` | `import { render, screen } from '@testing-library/react'█` | +| `itv→` | `import { render, screen } from '@testing-library/vue'█` | +| `itrh→` | `import { renderHook } from '@testing-library/react'█` | +| `itue→` | `import user from '@testing-library/user-event'█` | ### User Event @@ -100,6 +100,13 @@ Below is a list of all available snippets and the triggers of each one. The `░ | `gabr→` | `screen.getAllByRole('░id')█` | | `gabro→` | `screen.getAllByRole('░id', {░})█` | +### Debug + +| Trigger | Result | +| -------: | ------------------------------------ | +| `sd→` | `screen.debug()█` | +| `sltp→` | `screen.logTestingPlaygroundURL()█` | + ⇧ [Back to menu](#menu) --- diff --git a/package.json b/package.json index 2e5e37e..6f2d363 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "testing-library-snippets", "description": "VS Code Testing Library snippets for JS and TS", - "version": "0.0.2", + "version": "0.0.3", "displayName": "Testing Library Snippets", "publisher": "deinsoftware", "icon": "images/light-icon.png", @@ -54,6 +54,10 @@ "language": "javascript", "path": "./snippets/queries.json" }, + { + "language": "javascript", + "path": "./snippets/debug.json" + }, { "language": "javascriptreact", "path": "./snippets/import.json" @@ -66,6 +70,10 @@ "language": "javascriptreact", "path": "./snippets/queries.json" }, + { + "language": "javascriptreact", + "path": "./snippets/debug.json" + }, { "language": "vue", "path": "./snippets/import.json" @@ -78,6 +86,10 @@ "language": "vue", "path": "./snippets/queries.json" }, + { + "language": "vue", + "path": "./snippets/debug.json" + }, { "language": "typescript", "path": "./snippets/import.json" @@ -90,6 +102,10 @@ "language": "typescript", "path": "./snippets/queries.json" }, + { + "language": "typescript", + "path": "./snippets/debug.json" + }, { "language": "typescriptreact", "path": "./snippets/import.json" @@ -101,6 +117,10 @@ { "language": "typescriptreact", "path": "./snippets/queries.json" + }, + { + "language": "typescriptreact", + "path": "./snippets/debug.json" } ] }, diff --git a/snippets/debug.json b/snippets/debug.json new file mode 100644 index 0000000..88b7aba --- /dev/null +++ b/snippets/debug.json @@ -0,0 +1,12 @@ +{ + "screen.debug": { + "prefix": "sd", + "body": "screen.debug()$0", + "description": "screen debug" + }, + "screen.log.testing-playground": { + "prefix": "sltp", + "body": "screen.logTestingPlaygroundURL()$0", + "description": "screen log testing playground url" + } +} diff --git a/test/snippets.test.js b/test/snippets.test.js index 3b326c8..7f2c58f 100644 --- a/test/snippets.test.js +++ b/test/snippets.test.js @@ -3,11 +3,13 @@ import { it, expect, describe } from 'vitest' const importSnippets = require("../snippets/import.json") const userEventSnippets = require("../snippets/user-event.json") const queriesSnippets = require("../snippets/queries.json") +const debugSnippets = require("../snippets/debug.json") const snippets = { ...importSnippets, ...userEventSnippets, ...queriesSnippets, + ...debugSnippets, } const unique = (xs) => [...new Set(xs)]