This file contains hidden or 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
describe('Component', () => { | |
let wrapper: ReactWrapper; | |
beforeEach(() => { | |
// arrange | |
// mock useEffect function | |
jest | |
.spyOn(React, 'useEffect') | |
.mockImplementation(f => f()); | |
}); |
This file contains hidden or 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
var flagtests = []struct { | |
in string | |
out string | |
}{ | |
{"%a", "[%a]"}, | |
{"%-a", "[%-a]"}, | |
{"%+a", "[%+a]"}, | |
{"%#a", "[%#a]"}, | |
{"% a", "[% a]"}, | |
{"%0a", "[%0a]"}, |
This file contains hidden or 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
import { getAnimal } from './util'; | |
describe('getAnimal', () => { | |
context('when passing code 1', () => { | |
it('should get CATS', () => { | |
const result = getAnimal(1) | |
expect(result).toEqual('CATS') | |
}) | |
}) |
This file contains hidden or 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
const cases = [ | |
{ | |
code: 1, | |
expected: 'CATS', | |
}, | |
{ | |
code: 2, | |
expected: 'DOGS', | |
}, | |
{ |
This file contains hidden or 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
"scripts": { | |
"start": "react-app-rewired start", | |
"build": "react-app-rewired build", | |
"test": "react-app-rewired test --env=jsdom", | |
"eject": "react-scripts eject", | |
"commit": "git-cz" | |
}, |
This file contains hidden or 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
module.exports = { | |
extends: [ | |
'react-app', | |
'plugin:prettier/recommended', | |
'prettier/react', | |
], | |
rules: { | |
quotes: ['error', 'single'], | |
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, | |
'no-console': process.env.NODE_ENV === 'production' ? 2 : 0, |
This file contains hidden or 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
{ | |
"scripts": { | |
"start": "react-app-rewired start", | |
"build": "react-app-rewired build", | |
"test": "react-app-rewired test --env=jsdom", | |
"eject": "react-scripts eject", | |
"commit": "git-cz", | |
"precommit": "lint-staged" // Added | |
}, | |
This file contains hidden or 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
import React from 'react' | |
import { ThemeProvider } from 'styled-components' | |
import theme from 'src/styles/theme' | |
import GlobalStyle from 'src/styles/global' | |
import Home from 'src/components/Home' | |
const App: React.FC = (props) => { | |
return ( | |
<ThemeProvider theme={theme}> | |
<> |
This file contains hidden or 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
import { css, createGlobalStyle } from 'styled-components' | |
import ress from 'src/styles/ress' | |
import { Theme } from 'src/styles/theme' | |
const global = css<Theme>` | |
html { | |
scroll-behavior: smooth; | |
} | |
body { |
This file contains hidden or 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
import { primaryColour, textColour, textSubColour } from 'src/styles/variables' | |
const theme = { | |
space: [0, 4, 8, 16, 32, 64, 128, 256, 512], | |
colors: { | |
primary: primaryColour, | |
secondary: '', | |
text: { | |
primary: textColour, |