npm i -D prettier
- package.json scripts:
"format": "prettier \"src/**/*.{js,html}\" --write"
touch .prettierrc
avec :{ "trailingComma": "es5" }
- Enable the option Run on save for files.
export const ACTIONS = { | |
GET_USER_REQUEST: "GET_USER_REQUEST", | |
GET_USER_SUCCESS: "GET_USER_SUCCESS", | |
GET_USER_FAILURE: "GET_USER_FAILURE" | |
}; | |
export const initialState = { | |
isFetching: false, | |
errors: [], | |
profile: {} |
describe("here name which function or feature you are testing", () => { | |
it("here explain what specific part of the feature should do", () => { | |
expect(1 + 1).toBe(2); | |
}); | |
}); |
import React from 'react'; | |
import ShallowRenderer from 'react-test-renderer/shallow'; | |
import AppBar from '../'; | |
describe('<AppBar />', () => { | |
const renderer = new ShallowRenderer(); | |
it('should match snapshot without props', () => { | |
renderer.render(<AppBar />); |
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
const AppBar = ({ | |
children, | |
className, | |
iconElementLeft, | |
iconElementRight, | |
title, | |
titleStyle, |