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
jest.mock('react', () => { | |
const react = jest.requireActual('react'); | |
const reactTestingLibrary = jest.requireActual('react-testing-library'); | |
return { | |
...react, | |
useState: initial => { | |
const [state, setState] = react.useState(initial); | |
return [ | |
state, |
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
{ | |
"scripts": { | |
"env": "NODE_OPTIONS='-r dotenv/config' npm run", // runs a given npm script with .env environment variables | |
"foo": "curl --user $USER:$PASSWORD $ENDPOINT" // sample script, run this with: npm run env foo | |
} | |
} |