Skip to content

@xstate/test@2.0.0-alpha.4

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 19 Oct 21:41
· 18 commits to main since this release
c628b91

Major Changes

  • 5b6df81: @xstate/test/effect-schema now requires stable Effect 4 (effect@^4.0.0). fromEffectSchema() builds fast-check arbitraries from the schema's AST. It supports primitives, literals, enums, unions, arrays, tuples, structs with optional properties, records with string keys, and refinements. Unsupported nodes such as Schema.Date throw an error naming the node. Pass override to supply an arbitrary for them:

    import * as fc from 'fast-check';
    import * as Schema from 'effect/Schema';
    import { fromEffectSchema } from '@xstate/test/effect-schema';
    
    fromEffectSchema(Schema.Struct({ at: Schema.Date }), {
      override: (ast) =>
        ast._tag === 'Declaration' ? fc.date({ noInvalidDate: true }) : undefined
    });
  • 5b6df81: The @xstate/test entry point no longer exports the internal types PropertyExecutionConfig and PropertyTargetObservation.

    The vitest peer dependency now accepts Vitest 3 and Vitest 4.