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
import { CypressConfigTransformer } from './change-config-transformer'; | |
describe('Update Cypress Config', () => { | |
const defaultConfigContent = ` | |
import { defineConfig } from 'cypress'; | |
import { nxComponentTestingPreset } from '@nrwl/react/plugins/component-testing'; | |
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; | |
export default defineConfig({ |
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
//https://xstate.js.org/viz/?gist=4a78aae66feab67f9e90be4423a672da | |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// https://xstate.js.org/viz/?gist=e65afa5c88dcc41657771b85e4142da6 | |
const saveSelection = assign({ | |
available: (ctx, event) => { | |
console.log('available', ctx.available); | |
// do some logic in here to verify selection | |
ctx.available.splice(0, 1); | |
return ctx.available; | |
}, | |
selected: (ctx, event) => { |
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
// https://xstate.js.org/viz/?gist=0954f3bbb0b4cb2c98d486540a7f4ef2 | |
// import {assign, Machine} from 'xstate'; | |
// interface DraftContext { | |
// currentUser: string; | |
// users: string[]; | |
// elapsed: number; | |
// duration: number; | |
// round: number; | |
// interval: number; |
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
// https://xstate.js.org/viz/?gist=dbff7ab7affae922b6bc0ca461906a01 | |
// { | |
// "type": "USER_ADD", | |
// "user": { | |
// "name": "something", | |
// "isPending": true, | |
// "drafted": [] | |
// } | |
// } |
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
// Tutorial from docsk | |
// https://xstate.js.org/docs/tutorials/reddit.html#modeling-the-app | |
// Sample SELECT Event | |
const selectEvent = { type: 'SELECT', name: 'reactjs' }; | |
const invokeFetchSubreddit = context => { | |
const {subreddit} = context; | |
return fetch(`https://www.reddit.com/r/${subreddit}.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
// https://xstate.js.org/viz/?gist=917b7d0c4992306057067c08166fdb7d | |
const playingEffect = actions.assign( | |
ctx => ({ | |
pos: ctx.pos + 1 | |
}) | |
); | |
const forwardingEffect = actions.assign( | |
ctx => ({ |