Last active
May 13, 2022 14:26
-
-
Save IliasDeros/3d49d48b9472030ef784ef09228ed499 to your computer and use it in GitHub Desktop.
VSCode snippets. Add them in Preferences: Configure User snippets > typescriptreact.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"React component test": { | |
"prefix": "react_test", | |
"body": [ | |
"import React from 'react'", | |
"import { render } from '@testing-library/react'", | |
"import { $1 } from '../$1'", | |
"", | |
"describe('$1', () => {", | |
" let props", | |
"", | |
" beforeEach(() => {", | |
" props = {", | |
" ", | |
" }", | |
" })", | |
"", | |
" it('renders', () => {", | |
" const { container } = render(<$1 {...props} />)", | |
" expect(container).toBeTruthy()", | |
" })", | |
"})" | |
], | |
"description": "Scaffold a test using react testing-library" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment