PageSourceSearch

https://fast-check.dev/assets/js/b426162c.baa41121.js

js fast-check.dev collected 2026-10-02 04:22:10 UTC 10,294 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["24770"],{68379(e,n,d){d.r(n),d.d(n,{metadata:()=>c,default:()=>o,frontMatter:()=>i,contentTitle:()=>t,toc:()=>h,assets:()=>l});var c=JSON.parse('{"id":"api/interfaces/AsyncCommand","title":"Interface: AsyncCommand\\\\<Model, Real, CheckAsync\\\\>","description":"Defined in10","source":"@site/docs/api/interfaces/AsyncCommand.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/AsyncCommand","permalink":"/docs/api/interfaces/AsyncCommand","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedBy":null,"lastUpdatedAt":null,"frontMatter":{"mdx":{"format":"md"}},"sidebar":"tutorialSidebar","previous":{"title":"Interface: ArrayConstraints","permalink":"/docs/api/interfaces/ArrayConstraints"},"next":{"title":"Interface: BigIntConstraints","permalink":"/docs/api/interfaces/BigIntConstraints"}}'),r=d(61058),s=d(24801);let i={mdx:{format:"md"}},t="Interface: AsyncCommand<Model, Real, CheckAsync>",l={},h=[{value:"Remarks",id:"remarks",level:2},{value:"Extends",id:"extends",level:2},{value:"Type Parameters",id:"type-parameters",level:2},{value:"Methods",id:"methods",level:2},{value:"check()",id:"check",level:3},{value:"Parameters",id:"parameters",level:4},{value:"Returns",id:"returns",level:4},{value:"Remarks",id:"remarks-1",level:4},{value:"Inherited from",id:"inherited-from",level:4},{value:"run()",id:"run",level:3},{value:"Parameters",id:"parameters-1",level:4},{value:"Returns",id:"returns-1",level:4},{value:"Remarks",id:"remarks-2",level:4},{value:"Inherited from",id:"inherited-from-1",level:4},{value:"toString()",id:"tostring",level:3},{value:"Returns",id:"returns-2",level:4},{value:"Remarks",id:"remarks-3",level:4},{value:"Inherited from",id:"inherited-from-2",level:4}];function a(e){let n={a:"a",blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",hr:"hr",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"interface-asynccommandmodel-real-checkasync",children:"Interface: AsyncCommand<Model, Real, CheckAsync>"})}),"\n",(0,r.jsxs)(n.p,{children:["Defined in: ",(0,r.jsx)(n.a,{href:"https://github.com/dubzzz/fast-check/blob/014cc87e29e807fd7028e4cc05d8a6cd12da172b/packages/fast-check/src/check/model/command/AsyncCommand.ts#L10",children:"packages/fast-check/src/check/model/command/AsyncCommand.ts:10"})]}),"\n",(0,r.jsx)(n.p,{children:"Interface that should be implemented in order to define\nan asynchronous command"}),"\n",(0,r.jsx)(n.h2,{id:"remarks",children:"Remarks"}),"\n",(0,r.jsx)(n.p,{children:"Since 1.5.0"}),"\n",(0,r.jsx)(n.h2,{id:"extends",children:"Extends"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"/docs/api/interfaces/ICommand",children:(0,r.jsx)(n.code,{children:"ICommand"})}),"<",(0,r.jsx)(n.code,{children:"Model"}),", ",(0,r.jsx)(n.code,{children:"Real"}),", ",(0,r.jsx)(n.code,{children:"Promise"}),"<",(0,r.jsx)(n.code,{children:"void"}),">, ",(0,r.jsx)(n.code,{children:"CheckAsync"}),">"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"type-parameters",children:"Type Parameters"}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Type Parameter"}),(0,r.jsx)(n.th,{children:"Default type"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"Model"})," ",(0,r.jsx)(n.em,{children:"extends"})," ",(0,r.jsx)(n.code,{children:"object"})]}),(0,r.jsx)(n.td,{children:"-"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"Real"})}),(0,r.jsx)(n.td,{children:"-"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"CheckAsync"})," ",(0,r.jsx)(n.em,{children:"extends"})," ",(0,r.jsx)(n.code,{children:"boolean"})]}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"methods",children:"Methods"}),"\n",(0,r.jsx)(n.h3,{id:"check",children:"check()"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"check"}),"(",(0,r.jsx)(n.code,{children:"m"}),"): ",(0,r.jsx)(n.code,{children:"CheckAsync"})," ",(0,r.jsx)(n.em,{children:"extends"})," ",(0,r.jsx)(n.code,{children:"false"})," ? ",(0,r.jsx)(n.code,{children:"boolean"})," : ",(0,r.jsx)(n.code,{children:"Promise"}),"<",(0,r.jsx)(n.code,{children:"boolean"}),">"]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Defined in: ",(0,r.jsx)(n.a,{href:"https://github.com/dubzzz/fast-check/blob/014cc87e29e807fd7028e4cc05d8a6cd12da172b/packages/fast-check/src/check/model/command/ICommand.ts#L21",children:"packages/fast-check/src/check/model/command/ICommand.ts:21"})]}),"\n",(0,r.jsx)(n.p,{children:"Check if the model is in the right state to apply the command"}),"\n",(0,r.jsx)(n.p,{children:"WARNING: does not change the model"}),"\n",(0,r.jsx)(n.h4,{id:"parameters",children:"Parameters"}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Parameter"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsx)(n.tbody,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"m"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"Readonly"}),"<",(0,r.jsx)(n.code,{children:"Model"}),">"]}),(0,r.jsx)(n.td,{children:"Model, simplified or schematic representation of real system"})]})})]}),"\n",(0,r.jsx)(n.h4,{id:"returns",children:"Returns"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"CheckAsync"})," ",(0,r.jsx)(n.em,{children:"extends"})," ",(0,r.jsx)(n.code,{children:"false"})," ? ",(0,r.jsx)(n.code,{children:"boolean"})," : ",(0,r.jsx)(n.code,{children:"Promise"}),"<",(0,r.jsx)(n.code,{children:"boolean"}),">"]}),"\n",(0,r.jsx)(n.h4,{id:"remarks-1",children:"Remarks"}),"\n",(0,r.jsx)(n.p,{children:"Since 1.5.0"}),"\n",(0,r.jsx)(n.h4,{id:"inherited-from",children:"Inherited from"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"/docs/api/interfaces/ICommand",children:(0,r.jsx)(n.code,{children:"ICommand"})}),".",(0,r.jsx)(n.a,{href:"/docs/api/interfaces/ICommand#check",children:(0,r.jsx)(n.code,{children:"check"})})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"run",children:"run()"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"run"}),"(",(0,r.jsx)(n.code,{children:"m"}),", ",(0,r.jsx)(n.code,{children:"r"}),"): ",(0,r.jsx)(n.code,{children:"Promise"})]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Defined in: ",(0,r.jsx)(n.a,{href:"https://github.com/dubzzz/fast-check/blob/014cc87e29e807fd7028e4cc05d8a6cd12da172b/packages/fast-check/src/check/model/command/ICommand.ts#L33",children:"packages/fast-check/src/check/model/command/ICommand.ts:33"})]}),"\n",(0,r.jsx)(n.p,{children:"Receive the non-updated model and the real or system under test.\nPerform the checks post-execution - Throw in case of invalid state.\nUpdate the model accordingly"}),"\n",(0,r.jsx)(n.h4,{id:"parameters-1",children:"Parameters"}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Parameter"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"m"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"Model"})}),(0,r.jsx)(n.td,{children:"Model, simplified or schematic representation of real system"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"r"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"Real"})}),(0,r.jsx)(n.td,{children:"Sytem under test"})]})]})]}),"\n",(0,r.jsx)(n.h4,{id:"returns-1",children:"Returns"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"Promise"})}),"\n",(0,r.jsx)(n.h4,{id:"remarks-2",children:"Remarks"}),"\n",(0,r.jsx)(n.p,{children:"Since 1.5.0"}),"\n",(0,r.jsx)(n.h4,{id:"inherited-from-1",children:"Inherited from"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"/docs/api/interfaces/ICommand",children:(0,r.jsx)(n.code,{children:"ICommand"})}),".",(0,r.jsx)(n.a,{href:"/docs/api/interfaces/ICommand#run",children:(0,r.jsx)(n.code,{children:"run"})})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"tostring",children:"toString()"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"toString"}),"(): ",(0,r.jsx)(n.code,{children:"string"})]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Defined in: ",(0,r.jsx)(n.a,{href:"https://github.com/dubzzz/fast-check/blob/014cc87e29e807fd7028e4cc05d8a6cd12da172b/packages/fast-check/src/check/model/command/ICommand.ts#L39",children:"packages/fast-check/src/check/model/command/ICommand.ts:39"})]}),"\n",(0,r.jsx)(n.p,{children:"Name of the command"}),"\n",(0,r.jsx)(n.h4,{id:"returns-2",children:"Returns"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"string"})}),"\n",(0,r.jsx)(n.h4,{id:"remarks-3",children:"Remarks"}),"\n",(0,r.jsx)(n.p,{children:"Since 1.5.0"}),"\n",(0,r.jsx)(n.h4,{id:"inherited-from-2",children:"Inherited from"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"/docs/api/interfaces/ICommand",children:(0,r.jsx)(n.code,{children:"ICommand"})}),".",(0,r.jsx)(n.a,{href:"/docs/api/interfaces/ICommand#tostring",children:(0,r.jsx)(n.code,{children:"toString"})})]})]})}function o(e={}){let{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},24801(e,n,d){d.d(n,{R:()=>i,x:()=>t});var c=d(13706);let r={},s=c.createContext(r);function i(e){let n=c.useContext(s);return c.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function t(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),c.createElement(s.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.