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
| export const StateMachineContext = React.createContext() | |
| export function StateMachine ({ | |
| states, | |
| initialContext, | |
| initialState, | |
| children, | |
| }) { | |
| const [context, setContext] = useState(initialContext) | |
| const [state, setState] = useState(initialState) |
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
| context('To Do Items', () => { | |
| it('Should display a list of to do items', () => { | |
| cy.intercept({ | |
| method: 'GET', | |
| url: new RegExp(`${REACT_APP_TODO_API_URL}/v1/to-dos`) | |
| }, { | |
| fixture: 'todos.json` | |
| }).as('loadToDos'); | |
| cy.visit('/'); |
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_APP_TODO_API_URL } from './constants.js'; | |
| cy.intercept({ | |
| method: 'GET', | |
| url: new RegExp(`${REACT_APP_TODO_API_URL}`/v1/to-dos`) | |
| }, { | |
| fixture: 'todos.json` | |
| }) |
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
| REACT_APP_TODO_API_URL=http://somewhere-over-the-rainbow.io |
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": "PORT=3000 react-scripts start", | |
| "build": "react-scripts build", | |
| "test": "react-scripts test", | |
| "eject": "react-scripts eject", | |
| "serve": "http-server ./build -p 3000 --proxy http://localhost:3000?", | |
| "cy:open": "CYPRESS_BASE_URL=http://localhost:3000 cypress open", | |
| "cy:run": "CYPRESS_BASE_URL=http://localhost:3000 cypress run", | |
| "cy:ci": "start-server-and-test serve http://localhost:3000 cy:run" |
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
| // config-overrides.js | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const { | |
| override, | |
| removeModuleScopePlugin, | |
| babelInclude, | |
| addWebpackAlias, | |
| } = require('customize-cra'); |
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
| // @me/my-local-package/package.json | |
| { | |
| "peerDependencies": { | |
| "react": ">=16.0.0", | |
| "react-dom": ">=16.0.0" | |
| }, | |
| "devDependencies": { | |
| "react": "^16.13.0", | |
| "react-dom": "^16.13.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
| // config-overrides.js | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const { | |
| override, | |
| removeModuleScopePlugin, | |
| babelInclude, | |
| } = require('customize-cra'); | |
| module.exports = override( |
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
| // config-overrides.js | |
| const { | |
| override, | |
| removeModuleScopePlugin, | |
| } = require('customize-cra'); | |
| module.exports = override( | |
| removeModuleScopePlugin() | |
| ); |
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
| // config-overrides.js | |
| const { override } = require('customize-cra'); | |
| module.exports = override(); |