Tests / @ogygia/machine
@ogygia/machine
Version 0.13.1
4b18f465 627 test runs (315 tests, each run in Node, the browsers or both)
1.59× lines of test for each line of source (4,504 to 2,832) Only real test code counts: test files and their helpers, not fixtures, sample apps or benches.
Blank lines are left out on both sides.
Exactly what is counted
non-blank lines of test code across the repo (*.test.ts, *.test-d.ts, *.spec.ts, and the .ts helpers in test/ and e2e/ folders; no fixtures, fixture apps, stubs or benches), over non-blank lines of packages/*/src (no .d.ts or generated files)96.8% of source lines run by the tests
- 315Unit
- 312Browser
- 0End to end
- 0Type tests
- 0Lint rules
- 0Failing
Coverage
- 96.8%Lines
- 95.9%Branches
- 91.4%Functions
- 96.3%Statements
Every test
End-to-end suites are not part of this report yet.
315 tests
| Test | Kind | Node | Chromium | Firefox | WebKit |
|---|---|---|---|---|---|
packages/machine/test/after.test.ts | |||||
| after: a state that ends on its own > a cleanup that throws during the timed step is reported, and the step is still taken | Unit, Browser | pass | pass | pass | pass |
| after: a state that ends on its own > a move out first cancels it: no late step, no timer left | Unit, Browser | pass | pass | pass | pass |
| after: a state that ends on its own > a state with no `after` costs no timer | Unit, Browser | pass | pass | pass | pass |
| after: a state that ends on its own > a step to itself is a new visit too | Unit, Browser | pass | pass | pass | pass |
| after: a state that ends on its own > a time made from the state’s value: the retry waits longer each attempt | Unit, Browser | pass | pass | pass | pass |
| after: a state that ends on its own > a timed step that fails (its data throws) is reported; the machine stays where it is | Unit, Browser | pass | pass | pass | pass |
| after: a state that ends on its own > an initial state with a timeout starts its time when the machine is made | Unit, Browser | pass | pass | pass | pass |
| after: a state that ends on its own > an observer that moves the machine during the timed step leaves no stray timer | Unit, Browser | pass | pass | pass | pass |
| after: a state that ends on its own > coming back starts the time again (the old visit’s time never fires) | Unit, Browser | pass | pass | pass | pass |
| after: a state that ends on its own > still in the state when its time is up: the machine takes the step, with its data | Unit, Browser | pass | pass | pass | pass |
| after: a state that ends on its own > stop() cancels it | Unit, Browser | pass | pass | pass | pass |
| after: a state that ends on its own > the timed step is a move like any other: tasks end, cleanups run, waits and observers hear it | Unit, Browser | pass | pass | pass | pass |
| after: refused definitions > a state that is not a state | Unit, Browser | pass | pass | pass | pass |
| after: refused definitions > a target that is not one of the state’s steps | Unit, Browser | pass | pass | pass | pass |
| after: refused definitions > a time made from the state that is not a time: reported, and the state does not end at once | Unit, Browser | pass | pass | pass | pass |
| after: refused definitions > a time that is not a time, or longer than a timer can hold (2^31 - 1 ms, ~24.8 days) | Unit, Browser | pass | pass | pass | pass |
| after: refused definitions > the longest time a timer holds is accepted | Unit, Browser | pass | pass | pass | pass |
packages/machine/test/flights.test.ts | |||||
| fresh > a fresh flight ends the one already out: its callers get STALE | Unit, Browser | pass | pass | pass | pass |
| fresh > a fresh flight over one whose callers have signals: they get STALE, and their leaving later stops nothing | Unit, Browser | pass | pass | pass | pass |
| fresh > a refresh that fails, or answers what is not kept, leaves the kept answer in place | Unit, Browser | pass | pass | pass | pass |
| fresh > starts a new flight beside the kept answer, which stays until the new one lands | Unit, Browser | pass | pass | pass | pass |
| fresh > the last caller of a refresh leaving puts the kept answer back | Unit, Browser | pass | pass | pass | pass |
| keep, max and weigh > `keep` made from the answer: 0 keeps nothing (callers share the flight while it is out) | Unit, Browser | pass | pass | pass | pass |
| keep, max and weigh > `max` counts answers: past it the least recently used goes first | Unit, Browser | pass | pass | pass | pass |
| keep, max and weigh > `weigh` puts each answer against `max`; one heavier than all of `max` is not kept | Unit, Browser | pass | pass | pass | pass |
| keep, max and weigh > a keep or weigh that throws fails the flight and keeps nothing | Unit, Browser | pass | pass | pass | pass |
| keep, max and weigh > a refresh out keeps its prior against `max` until it lands; nothing kept passes `max` after | Unit, Browser | pass | pass | pass | pass |
| keep, max and weigh > a weight below 0 or not a number is not kept, so `max` still caps (#355)#355 | Unit, Browser | pass | pass | pass | pass |
| keep, max and weigh > an expired answer goes before a live one is pushed out (#356)#356 | Unit, Browser | pass | pass | pass | pass |
| keep, max and weigh > an expired answer is swept out when a new flight starts | Unit, Browser | pass | pass | pass | pass |
| keep, max and weigh > keeps an answer for `keep` ms, real time, then runs again | Unit, Browser | pass | pass | pass | pass |
| keyed > `key` names the fields that are one flight; the input that started it is the one that runs | Unit, Browser | pass | pass | pass | pass |
| keyed > a caller that leaves gets STALE at once; the work stops only when the last one has left | Unit, Browser | pass | pass | pass | pass |
| keyed > a caller whose signal already aborted gets STALE and starts nothing | Unit, Browser | pass | pass | pass | pass |
| keyed > a caller with no signal holds the flight: the others leaving does not stop it | Unit, Browser | pass | pass | pass | pass |
| keyed > a drop ends the flight out: every caller gets STALE, its signal aborts, nothing is kept | Unit, Browser | pass | pass | pass | pass |
| keyed > a drop predicate that gets or drops as it is asked: every key is asked once, every caller settles | Unit, Browser | pass | pass | pass | pass |
| keyed > a failure that lands after a drop is STALE, not a failure, for the callers of that flight | Unit, Browser | pass | pass | pass | pass |
| keyed > a kept answer reaches a caller with a signal too | Unit, Browser | pass | pass | pass | pass |
| keyed > a key field compares objects by identity, and keeps every kind of value apart | Unit, Browser | pass | pass | pass | pass |
| keyed > a keyed flights refuses a key it cannot use, where it is written | Unit, Browser | pass | pass | pass | pass |
| keyed > a missing key field and one that is undefined are one key; a registered symbol is one by its name | Unit, Browser | pass | pass | pass | pass |
| keyed > a run that gets its own key before it returns joins its own flight (#354)#354 | Unit, Browser | pass | pass | pass | pass |
| keyed > drop by key fields, or by a predicate over them (never over the rest of the input) | Unit, Browser | pass | pass | pass | pass |
| keyed > drop takes a predicate, over kept answers and flights out alike | Unit, Browser | pass | pass | pass | pass |
| keyed > one flight per key: the same key joins, another key runs on its own | Unit, Browser | pass | pass | pass | pass |
| keyed > runs inside the get that starts it, with a signal of its own | Unit, Browser | pass | pass | pass | pass |
| keyed > two inputs that differ in any key field never share an answer | Unit, Browser | pass | pass | pass | pass |
| one key (what once() was) > a deadline aborts the try out and fails with a TimeoutError | Unit, Browser | pass | pass | pass | pass |
| one key (what once() was) > a drop during the wait between tries ends them: STALE, no next try | Unit, Browser | pass | pass | pass | pass |
| one key (what once() was) > a run that throws synchronously is a failure too | Unit, Browser | pass | pass | pass | pass |
| one key (what once() was) > callers while it runs share the one run, and the same promise | Unit, Browser | pass | pass | pass | pass |
| one key (what once() was) > every caller of a failed run gets the failure, then the next get starts fresh | Unit, Browser | pass | pass | pass | pass |
| one key (what once() was) > gives the last failure when its tries run out | Unit, Browser | pass | pass | pass | pass |
| one key (what once() was) > its own handling of a failure adds no unhandled rejection | Unit, Browser | pass | pass | pass | pass |
| one key (what once() was) > never keeps a failure: the next get runs again | Unit, Browser | pass | pass | pass | pass |
| one key (what once() was) > refuses options it cannot take | Unit, Browser | pass | pass | pass | pass |
| one key (what once() was) > runs on the first get and keeps the answer | Unit, Browser | pass | pass | pass | pass |
| one key (what once() was) > takes a plain value | Unit, Browser | pass | pass | pass | pass |
| one key (what once() was) > tries again at once before it fails, within the turn: no timer between tries | Unit, Browser | pass | pass | pass | pass |
| one key (what once() was) > waits between tries as its policy says, real timers | Unit, Browser | pass | pass | pass | pass |
| owned > a disposed flights drops everything and runs nothing after | Unit, Browser | pass | pass | pass | pass |
| owned > a scope adopts it: closing the scope ends its flights | Unit, Browser | pass | pass | pass | pass |
| under load (real concurrency) > random gets, leaves, drops and answers: one run per flight, every caller settles, nothing failed is kept | Unit, Browser | pass | pass | pass | pass |
packages/machine/test/graph.test.ts | |||||
| graph() > every state, its steps, whether it is final, and its own timeout | Unit, Browser | pass | pass | pass | pass |
| graph() > is plain data: it survives JSON (devtools send it over the wire) | Unit, Browser | pass | pass | pass | pass |
| paths() > between them they take every step of the definition | Unit, Browser | pass | pass | pass | pass |
| paths() > every path can be driven: each move along it is allowed | Unit, Browser | pass | pass | pass | pass |
| paths() > one path per step, each the shortest that reaches its state and takes it | Unit, Browser | pass | pass | pass | pass |
packages/machine/test/lock.test.ts | |||||
| lock > a free lock refuses any free | Unit, Browser | pass | pass | pass | pass |
| lock > acquire: an abort after its turn changes nothing | Unit, Browser | pass | pass | pass | pass |
| lock > acquire: an abort before its turn leaves the queue and rejects with the reason | Unit, Browser | pass | pass | pass | pass |
| lock > acquire: an already aborted signal rejects at once and never takes it | Unit, Browser | pass | pass | pass | pass |
| lock > acquire: at once when free | Unit, Browser | pass | pass | pass | pass |
| lock > acquire: waits its turn, first come first served, handed straight on | Unit, Browser | pass | pass | pass | pass |
| lock > every take gets a new token | Unit, Browser | pass | pass | pass | pass |
| lock > freeing twice does nothing the second time | Unit, Browser | pass | pass | pass | pass |
| lock > only the token that holds it frees it | Unit, Browser | pass | pass | pass | pass |
| lock > random runs agree with a model: one owner, exact held, first come first served | Unit, Browser | pass | pass | pass | pass |
| lock > seize: takes it from a stuck owner, whose late free is then refused | Unit, Browser | pass | pass | pass | pass |
| lock > take: one owner at a time | Unit, Browser | pass | pass | pass | pass |
packages/machine/test/machine.test.ts | |||||
| definition > a one-state machine works (initial, final) | Unit, Browser | pass | pass | pass | pass |
| definition > copies the steps: changing the object it was given changes nothing | Unit, Browser | pass | pass | pass | pass |
| definition > keeps its name, initial and steps, frozen | Unit, Browser | pass | pass | pass | pass |
| definition > names its error: a MachineError with the code and its page | Unit, Browser | pass | pass | pass | pass |
| definition > refuses a state that can never be reached | Unit, Browser | pass | pass | pass | pass |
| definition > refuses a step listed twice | Unit, Browser | pass | pass | pass | pass |
| definition > refuses a step to a state that is not a state | Unit, Browser | pass | pass | pass | pass |
| definition > refuses an initial state that is not a state | Unit, Browser | pass | pass | pass | pass |
| definition > starts in an initial state that carries data | Unit, Browser | pass | pass | pass | pass |
| definition > treats state names like Object.prototype keys as plain names | Unit, Browser | pass | pass | pass | pass |
| go > a final state goes nowhere | Unit, Browser | pass | pass | pass | pass |
| go > a state can step to itself (a fresh visit) | Unit, Browser | pass | pass | pass | pass |
| go > moves along a step and says so | Unit, Browser | pass | pass | pass | pass |
| go > throws in dev for a move the steps do not allow, and stays put | Unit, Browser | pass | pass | pass | pass |
| machines are independent > machines of different definitions do not mix | Unit, Browser | pass | pass | pass | pass |
| machines are independent > the STALE symbol is the same across copies of the package | Unit, Browser | pass | pass | pass | pass |
| machines are independent > two machines of one definition share nothing | Unit, Browser | pass | pass | pass | pass |
| move > moves when the machine is still in from | Unit, Browser | pass | pass | pass | pass |
| move > refuses quietly when something else moved it first | Unit, Browser | pass | pass | pass | pass |
| move > throws in dev for a step that does not exist, even when not in from | Unit, Browser | pass | pass | pass | pass |
| now > a dataless state entered with {} is still that state | Unit, Browser | pass | pass | pass | pass |
| now > a dataless step to itself is a new visit too | Unit, Browser | pass | pass | pass | pass |
| now > carries the data of the state it is in, frozen in dev | Unit, Browser | pass | pass | pass | pass |
| now > copies the data: changing the object passed in changes nothing | Unit, Browser | pass | pass | pass | pass |
| now > is a new value on every visit, with no data too: a saved now tells the visits apart | Unit, Browser | pass | pass | pass | pass |
| now > is the same value for as long as the visit lasts | Unit, Browser | pass | pass | pass | pass |
| now > refuses data with its own kind | Unit, Browser | pass | pass | pass | pass |
| now > starts in initial, a value of its own, frozen in dev | Unit, Browser | pass | pass | pass | pass |
| observe > an observer that moves the machine again sees both moves in order | Unit, Browser | pass | pass | pass | pass |
| observe > an observer that throws does not break the move or the other observers | Unit, Browser | pass | pass | pass | pass |
| observe > an observer that unsubscribes itself mid-move does not skip the next one | Unit, Browser | pass | pass | pass | pass |
| observe > hears every move and the stop, with the machine | Unit, Browser | pass | pass | pass | pass |
| observe > hears nothing for a refused move | Unit, Browser | pass | pass | pass | pass |
| observe > stops hearing once it unsubscribes | Unit, Browser | pass | pass | pass | pass |
| scope.defer: cleanups of one visit > a cleanup that moves the machine again works, and the next visit starts clean | Unit, Browser | pass | pass | pass | pass |
| scope.defer: cleanups of one visit > a refused move runs no cleanup | Unit, Browser | pass | pass | pass | pass |
| scope.defer: cleanups of one visit > belongs to the visit it was added in | Unit, Browser | pass | pass | pass | pass |
| scope.defer: cleanups of one visit > one that throws does not stop the others or the move; the move throws after | Unit, Browser | pass | pass | pass | pass |
| scope.defer: cleanups of one visit > runs at once on a stopped machine | Unit, Browser | pass | pass | pass | pass |
| scope.defer: cleanups of one visit > runs once when the machine leaves, newest first | Unit, Browser | pass | pass | pass | pass |
| scope.defer: cleanups of one visit > sees the new state already in place | Unit, Browser | pass | pass | pass | pass |
| scope.defer: cleanups of one visit > several that throw come back together | Unit, Browser | pass | pass | pass | pass |
| scope.defer: cleanups of one visit > the signal aborts before the cleanups run | Unit, Browser | pass | pass | pass | pass |
| scope.task: work of one visit > a move with no task makes no abort controller | Unit, Browser | pass | pass | pass | pass |
| scope.task: work of one visit > a stopped machine does not run work | Unit, Browser | pass | pass | pass | pass |
| scope.task: work of one visit > drops an answer that lands after the machine left | Unit, Browser | pass | pass | pass | pass |
| scope.task: work of one visit > drops it even when the machine came back to the same state (a new visit) | Unit, Browser | pass | pass | pass | pass |
| scope.task: work of one visit > drops it on a step to itself too | Unit, Browser | pass | pass | pass | pass |
| scope.task: work of one visit > gives the answer while the machine stays put | Unit, Browser | pass | pass | pass | pass |
| scope.task: work of one visit > passes a live signal, aborted once the machine leaves | Unit, Browser | pass | pass | pass | pass |
| scope.task: work of one visit > rejects with the failure while the machine stays put | Unit, Browser | pass | pass | pass | pass |
| scope.task: work of one visit > settles with STALE the moment the machine leaves, even when work never finishes | Unit, Browser | pass | pass | pass | pass |
| scope.task: work of one visit > takes a plain value too | Unit, Browser | pass | pass | pass | pass |
| scope.task: work of one visit > tasks of one visit share one signal; the next visit gets a new one | Unit, Browser | pass | pass | pass | pass |
| scope.task: work of one visit > turns a failure after the machine left into STALE (no unhandled error) | Unit, Browser | pass | pass | pass | pass |
| scope.task: work of one visit > turns a synchronous throw into a rejection | Unit, Browser | pass | pass | pass | pass |
| scope.task: work of one visit > work that ignores its signal and answers late still gives STALE once | Unit, Browser | pass | pass | pass | pass |
| scope.task: work of one visit > work that moves the machine itself gives STALE | Unit, Browser | pass | pass | pass | pass |
| stop > a cleanup that throws on stop still runs the rest, then throws | Unit, Browser | pass | pass | pass | pass |
| stop > aborts tasks, runs cleanups, settles waits, refuses moves quietly | Unit, Browser | pass | pass | pass | pass |
| stop > twice is the same as once | Unit, Browser | pass | pass | pass | pass |
| wait > gives STALE as soon as the state cannot be reached any more | Unit, Browser | pass | pass | pass | pass |
| wait > gives STALE at once when the state is out of reach already | Unit, Browser | pass | pass | pass | pass |
| wait > many waits on many states settle each in turn | Unit, Browser | pass | pass | pass | pass |
| wait > settles at once when the machine is in the state | Unit, Browser | pass | pass | pass | pass |
| wait > settles with the state it entered, even if the machine moved on since | Unit, Browser | pass | pass | pass | pass |
| wait > settles with the state when the machine gets there | Unit, Browser | pass | pass | pass | pass |
| wait > stop settles every wait with STALE | Unit, Browser | pass | pass | pass | pass |
| wait > throws in dev for a state that does not exist | Unit, Browser | pass | pass | pass | pass |
packages/machine/test/mailbox.test.ts | |||||
| mailbox > a handler that never settles holds the box until its owner closes | Unit, Browser | pass | pass | pass | pass |
| mailbox > a handler waiting on two things at once lets one event in, not two at once (#341)#341 | Unit, Browser | pass | pass | pass | pass |
| mailbox > a timer of a handler that waits after its turn ended takes nobody’s turn (#341)#341 | Unit, Browser | pass | pass | pass | pass |
| mailbox > a wait from a handler whose turn already ended ends nobody’s turn (#341)#341 | Unit, Browser | pass | pass | pass | pass |
| mailbox > a wait from outside any turn ends nobody’s turn (#341)#341 | Unit, Browser | pass | pass | pass | pass |
| mailbox > a wait whose work settled while another handler held the turn hears STALE when the box closes | Unit, Browser | pass | pass | pass | pass |
| mailbox > an ask whose handler waits, then sees its element leave: STALE for the asker too | Unit, Browser | pass | pass | pass | pass |
| mailbox > ask() gives the handler’s value, sync or async, in its turn | Unit, Browser | pass | pass | pass | pass |
| mailbox > ends with its owner: queued events are dropped, a wait is STALE at once, later posts too | Unit, Browser | pass | pass | pass | pass |
| mailbox > gives a handler coming back from its wait no turn while another holds one | Unit, Browser | pass | pass | pass | pass |
| mailbox > holds the turn across a plain await: nothing else runs until the handler is back | Unit, Browser | pass | pass | pass | pass |
| mailbox > is closed for an owner already closed | Unit, Browser | pass | pass | pass | pass |
| mailbox > lets the next event in while a handler waits, and gives it its turn back behind it | Unit, Browser | pass | pass | pass | pass |
| mailbox > reports a queued handler that throws, and goes on with the next | Unit, Browser | pass | pass | pass | pass |
| mailbox > runs a long run of sync events queued in one turn, on a flat stack (#342)#342 | Unit, Browser | pass | pass | pass | pass |
| mailbox > runs an event posted during a turn after it, never inside it | Unit, Browser | pass | pass | pass | pass |
| mailbox > runs an event posted to an idle box at once, on the caller’s stack | Unit, Browser | pass | pass | pass | pass |
| mailbox > runs events in the order they were posted, across waits | Unit, Browser | pass | pass | pass | pass |
| mailbox > tells an asker whose event was dropped STALE | Unit, Browser | pass | pass | pass | pass |
| mailbox > throws a handler’s failure to its asker, and a wait’s rejection back in the turn | Unit, Browser | pass | pass | pass | pass |
| mailbox > throws a sync failure to its poster when it runs at once | Unit, Browser | pass | pass | pass | pass |
| mailbox > with no page error handler, a queued handler’s throw follows its code | Unit, Browser | pass | pass | pass | pass |
| mailbox > work that settles after the box closed changes nothing: the box stays closed and idle | Unit, Browser | pass | pass | pass | pass |
packages/machine/test/outbox.test.ts | |||||
| id > a put of an id still out joins it: one send | Unit, Browser | pass | pass | pass | pass |
| id > a receiver that failed to apply is tried again until it applies | Unit, Browser | pass | pass | pass | pass |
| id > done means applied: an answer lost after the apply is sent again, and the receiver drops the copy | Unit, Browser | pass | pass | pass | pass |
| inOrder > a put of an id still queued joins it: one send, in its place in line | Unit, Browser | pass | pass | pass | pass |
| inOrder > one given up does not stop the ones after it | Unit, Browser | pass | pass | pass | pass |
| inOrder > one send at a time, in put order, a failing one tried again before the next goes | Unit, Browser | pass | pass | pass | pass |
| inOrder > sends go out together without it | Unit, Browser | pass | pass | pass | pass |
| inOrder > the deadline counts from its own turn, not from the put | Unit, Browser | pass | pass | pass | pass |
| inOrder > with none ahead, the send starts inside the put; behind one, once it ends | Unit, Browser | pass | pass | pass | pass |
| policy > a list backs off by its entries (the last repeats); a number doubles | Unit, Browser | pass | pass | pass | pass |
| policy > a wait is always a number of 0 to the timer limit: before the first try, and after very many (#359)#359 | Unit, Browser | pass | pass | pass | pass |
| policy > fills what it leaves out from the standard one, and is frozen | Unit, Browser | pass | pass | pass | pass |
| policy > jitter cuts a wait by up to its share | Unit, Browser | pass | pass | pass | pass |
| policy > out of time before the next wait ends is a TimeoutError with the last error in it (#359)#359 | Unit, Browser | pass | pass | pass | pass |
| policy > refuses numbers it cannot use, where they are written | Unit, Browser | pass | pass | pass | pass |
| policy > the caller leaving and the deadline in the same turn: whichever came first says how it ended | Unit, Browser | pass | pass | pass | pass |
| policy > the outbox refuses a send that is not a function | Unit, Browser | pass | pass | pass | pass |
| put > a giveUp that throws is printed with the code | Unit, Browser | pass | pass | pass | pass |
| put > a send that throws before it returns is a failed try like any other | Unit, Browser | pass | pass | pass | pass |
| put > an id that is not a string or a finite number names nothing: not sent, said, false (#350)#350 | Unit, Browser | pass | pass | pass | pass |
| put > an id that throws: not sent, said, and put still never throws | Unit, Browser | pass | pass | pass | pass |
| put > gives up at once when the next wait would end past the deadline | Unit, Browser | pass | pass | pass | pass |
| put > ids 1 and "1" are two sends | Unit, Browser | pass | pass | pass | pass |
| put > out of tries: giveUp hears the last error once, and the put resolves false | Unit, Browser | pass | pass | pass | pass |
| put > returns at once, never throws, and resolves true once the send is done | Unit, Browser | pass | pass | pass | pass |
| put > the deadline aborts the try still out, and no try starts after it | Unit, Browser | pass | pass | pass | pass |
| put > tries a failed send again after its backoff, until one is done | Unit, Browser | pass | pass | pass | pass |
| put > with no giveUp, a send given up is printed once with its code | Unit, Browser | pass | pass | pass | pass |
| waitUntil > a platform that refuses it does not stop the send, and put does not throw | Unit, Browser | pass | pass | pass | pass |
| waitUntil > is handed each send, which settles when the send ends | Unit, Browser | pass | pass | pass | pass |
| waitUntil > puts that join one send each hand it over, and each settles when that one send ends | Unit, Browser | pass | pass | pass | pass |
packages/machine/test/process.node.test.ts | |||||
| a Node process > collects a flights nobody holds, and its world forgets it (#352)#352 | Unit | pass | not run | not run | not run |
| a Node process > frees a symbol a keyed flights spelled into a key, once nothing holds it (#357)#357 | Unit | pass | not run | not run | not run |
| a Node process > stays alive through the wait between two tries of a send (#351)#351 | Unit | pass | not run | not run | not run |
packages/machine/test/production.test.ts | |||||
| production > a saved now still tells two visits to one dataless state apart | Unit, Browser | pass | pass | pass | pass |
| production > a step to a state that does not exist is skipped by wait() and paths() too, not a throw (#358)#358 | Unit, Browser | pass | pass | pass | pass |
| production > does not freeze data values (a production build skips the dev-only copy checks) | Unit, Browser | pass | pass | pass | pass |
| production > prints again for a different wrong move | Unit, Browser | pass | pass | pass | pass |
| production > refuses a wrong move: false, stays put, prints the link once | Unit, Browser | pass | pass | pass | pass |
| production > skips the definition checks but still refuses an initial that is not a state | Unit, Browser | pass | pass | pass | pass |
| production > wait for a state that does not exist is STALE, not a throw | Unit, Browser | pass | pass | pass | pass |
packages/machine/test/random.test.ts | |||||
| random runs agree with the model > 2000 seeds × 120 steps | Unit, Browser | pass | pass | pass | pass |
packages/machine/test/scope.test.ts | |||||
| a machine visit is a scope > a move that throws from its cleanups names the machine | Unit, Browser | pass | pass | pass | pass |
| a machine visit is a scope > a stopped machine’s scope is closed: work does not run, cleanups run at once | Unit, Browser | pass | pass | pass | pass |
| a machine visit is a scope > a visit nothing hangs work on makes no scope | Unit, Browser | pass | pass | pass | pass |
| a machine visit is a scope > one scope per visit: the same through the visit, closed by leaving, a new one next time | Unit, Browser | pass | pass | pass | pass |
| a machine visit is a scope > what a visit holds is let go when the machine leaves: listeners, timers, observers | Unit, Browser | pass | pass | pass | pass |
| children > a child can close sooner on its own, and the parent then lets go of it | Unit, Browser | pass | pass | pass | pass |
| children > a cleanup that gives the closing scope more work gets the closed behaviour | Unit, Browser | pass | pass | pass | pass |
| children > a closed scope’s child is closed | Unit, Browser | pass | pass | pass | pass |
| children > close before the parent’s own cleanups, newest first | Unit, Browser | pass | pass | pass | pass |
| children > what a child throws is thrown by the parent’s close, after its own cleanups ran | Unit, Browser | pass | pass | pass | pass |
| close > a cleanup given to a closed scope runs at once | Unit, Browser | pass | pass | pass | pass |
| close > a cleanup that throws does not stop the others; close throws it after all have run | Unit, Browser | pass | pass | pass | pass |
| close > a release that throws does not stop the other releases or the cleanups (#346)#346 | Unit, Browser | pass | pass | pass | pass |
| close > is safe to call twice, and says it closed | Unit, Browser | pass | pass | pass | pass |
| close > more than one throws: an AggregateError, newest first | Unit, Browser | pass | pass | pass | pass |
| close > runs cleanups once, newest first | Unit, Browser | pass | pass | pass | pass |
| close > works with `using` | Unit, Browser | pass | pass | pass | pass |
| on > a closed scope does not listen at all | Unit, Browser | pass | pass | pass | pass |
| on > a once listener that fired lets go of itself: a long-lived scope does not pile them up (#348)#348 | Unit, Browser | pass | pass | pass | pass |
| on > a real window listener is gone after close | Unit, Browser | skip | pass | pass | pass |
| on > keeps the listener options (capture, once) and lets go early when asked | Unit, Browser | pass | pass | pass | pass |
| on > listens on a Node-style emitter (on / off) | Unit, Browser | pass | pass | pass | pass |
| on > listens on an event target until the scope closes | Unit, Browser | pass | pass | pass | pass |
| signal > a child’s signal aborts before its parent’s | Unit, Browser | pass | pass | pass | pass |
| signal > a scope nothing asks a signal of makes no abort controller | Unit, Browser | pass | pass | pass | pass |
| signal > aborts on close, before the cleanups run | Unit, Browser | pass | pass | pass | pass |
| signal > is one signal for the scope’s life; a closed scope’s is already aborted | Unit, Browser | pass | pass | pass | pass |
| task > a closed scope does not run work | Unit, Browser | pass | pass | pass | pass |
| task > a failure while open rejects; a throw at once too | Unit, Browser | pass | pass | pass | pass |
| task > an answer or a failure after the scope closed is STALE | Unit, Browser | pass | pass | pass | pass |
| task > gives the answer while the scope is open | Unit, Browser | pass | pass | pass | pass |
| task > settles with STALE the moment the scope closes, even when work never finishes | Unit, Browser | pass | pass | pass | pass |
| task > work that closes its own scope before it returns still settles with STALE (#349)#349 | Unit, Browser | pass | pass | pass | pass |
| timers > 'frame' and 'idle' run once (a frame, idle time, or the next task where there is none) | Unit, Browser | pass | pass | pass | pass |
| timers > a closed scope sets no timer | Unit, Browser | pass | pass | pass | pass |
| timers > a fired timeout lets go of itself: a long-lived scope does not pile them up | Unit, Browser | pass | pass | pass | pass |
| timers > closing clears a timeout that has not run; its cancel does too | Unit, Browser | pass | pass | pass | pass |
| timers > every repeats until the scope closes | Unit, Browser | pass | pass | pass | pass |
| timers > refuses a time a timer cannot hold | Unit, Browser | pass | pass | pass | pass |
| timers > timeout runs once after its time, real timers | Unit, Browser | pass | pass | pass | pass |
| watch and adopt > `await using` gets the errors of an async disposal; a plain close reports them | Unit, Browser | pass | pass | pass | pass |
| watch and adopt > a real MutationObserver stops hearing changes after close | Unit, Browser | skip | pass | pass | pass |
| watch and adopt > adopts what disposes itself, sync or async | Unit, Browser | pass | pass | pass | pass |
| watch and adopt > an async disposal adopted by a closed scope runs at once, is said when it fails, and is not kept (#347)#347 | Unit, Browser | pass | pass | pass | pass |
| watch and adopt > disconnects an observer on close (at once on a closed scope) | Unit, Browser | pass | pass | pass | pass |
| watch and adopt > disposes at once on a closed scope | Unit, Browser | pass | pass | pass | pass |
| watch and adopt > refuses what cannot dispose itself | Unit, Browser | pass | pass | pass | pass |
packages/machine/test/stage.test.ts | |||||
| a commit in progress > a commit that closes its owner and then throws still puts everything back | Unit, Browser | pass | pass | pass | pass |
| a commit in progress > a commit that closes its owner keeps what it committed (#343)#343 | Unit, Browser | pass | pass | pass | pass |
| after the commit > a discard step given after a discard runs at once | Unit, Browser | pass | pass | pass | pass |
| after the commit > a discard step given after the commit is dropped, not run (#344)#344 | Unit, Browser | pass | pass | pass | pass |
| after the commit > a stage that committed or was discarded leaves nothing on its owner (#345)#345 | Unit, Browser | pass | pass | pass | pass |
| an owner that closes first > an owner already closed never builds | Unit, Browser | pass | pass | pass | pass |
| an owner that closes first > ready is STALE at once, and what the build made so far is given back | Unit, Browser | pass | pass | pass | pass |
| an owner that closes first > the build’s signal aborts when the owner closes | Unit, Browser | pass | pass | pass | pass |
| build and commit > a commit after the owner closed is refused, and the build is given back | Unit, Browser | pass | pass | pass | pass |
| build and commit > a committed stage gives nothing back when its owner closes | Unit, Browser | pass | pass | pass | pass |
| build and commit > builds off to the side, then switches in at once | Unit, Browser | pass | pass | pass | pass |
| failures > a build that throws gives back what it made, and ready rejects | Unit, Browser | pass | pass | pass | pass |
| failures > a commit that throws puts back what it changed, gives back the build, and throws | Unit, Browser | pass | pass | pass | pass |
| failures > a step that throws is said once, and the others still run | Unit, Browser | pass | pass | pass | pass |
| failures > refuses a build or commit that is not a function | Unit, Browser | pass | pass | pass | pass |
packages/machine/test/stale-waits.test.ts | |||||
| a stale part makes the whole wait stale (#378) > a flights run: its callers get STALE, and nothing is kept (#377)#378 | Unit, Browser | pass | pass | pass | pass |
| a stale part makes the whole wait stale (#378) > a fresh flight that answers STALE gives the kept answer back#378 | Unit, Browser | pass | pass | pass | pass |
| a stale part makes the whole wait stale (#378) > a machine visit’s scope.task#378 | Unit, Browser | pass | pass | pass | pass |
| a stale part makes the whole wait stale (#378) > a mailbox turn’s wait, an outside wait and an ask#378 | Unit, Browser | pass | pass | pass | pass |
| a stale part makes the whole wait stale (#378) > a STALE answer of its own: the wait is STALE, and nothing is kept (#377)#378 | Unit, Browser | pass | pass | pass | pass |
| a stale part makes the whole wait stale (#378) > scope.task#378 | Unit, Browser | pass | pass | pass | pass |
| a stale part makes the whole wait stale (#378) > stage().ready#378 | Unit, Browser | pass | pass | pass | pass |
| a stale part makes the whole wait stale (#378) > under_policy#378 | Unit, Browser | pass | pass | pass | pass |
| only one level deep, only arrays > an array with no STALE comes through as it is | Unit, Browser | pass | pass | pass | pass |
| only one level deep, only arrays > objects and nested arrays are not scanned | Unit, Browser | pass | pass | pass | pass |
packages/machine/test/types.test.ts | |||||
| types > a stale part makes the whole wait stale: past the check, no slot is Stale (#378)#378 | Unit, Browser | pass | pass | pass | pass |
| types > after: a timeout takes one of its state’s steps, with the data that state needs | Unit, Browser | pass | pass | pass | pass |
| types > create takes the initial state data when it has some | Unit, Browser | pass | pass | pass | pass |
| types > flights: one key takes no input, a keyed one its input, answers may be STALE | Unit, Browser | pass | pass | pass | pass |
| types > go takes only states some step leads to, with their data | Unit, Browser | pass | pass | pass | pass |
| types > graph and paths name the states | Unit, Browser | pass | pass | pass | pass |
| types > lock | Unit, Browser | pass | pass | pass | pass |
| types > move checks the step itself | Unit, Browser | pass | pass | pass | pass |
| types > now is a union that narrows on kind | Unit, Browser | pass | pass | pass | pass |
| types > scope: listeners get the event their target names | Unit, Browser | pass | pass | pass | pass |
| types > task gives the answer or STALE | Unit, Browser | pass | pass | pass | pass |
| types > the definition is checked as it is written | Unit, Browser | pass | pass | pass | pass |
| types > wait gives that state or STALE | Unit, Browser | pass | pass | pass | pass |
packages/machine/test/world.test.ts | |||||
| a world > a keyed world moves only what read the keys it moved | Unit, Browser | pass | pass | pass | pass |
| a world > a stamp from the future is never fresh | Unit, Browser | pass | pass | pass | pass |
| a world > a stamp is fresh until the world moves, and only moves forward | Unit, Browser | pass | pass | pass | pass |
| a world > a whole move of a keyed world puts every stamp before it out of date | Unit, Browser | pass | pass | pass | pass |
| a world > an empty move moves nothing | Unit, Browser | pass | pass | pass | pass |
| a world > one move of more than KEYS_KEPT keys folds into the floor: out of date for every key, never fresh by mistake | Unit, Browser | pass | pass | pass | pass |
| a world > past KEYS_KEPT keys, the oldest move folds into the floor: never fresh when it is not | Unit, Browser | pass | pass | pass | pass |
| flights in a world > a disposed flights stops hearing its world | Unit, Browser | pass | pass | pass | pass |
| flights in a world > a keyed move drops the kept answers made from its keys, and only those | Unit, Browser | pass | pass | pass | pass |
| flights in a world > a move drops the kept answers and ends the flights out: their callers get STALE | Unit, Browser | pass | pass | pass | pass |
| flights in a world > a move of other keys keeps the flight out and its answer (#294)#294 | Unit, Browser | pass | pass | pass | pass |
| flights in a world > a refresh beside a kept answer: an answer made stale on the way leaves the kept one | Unit, Browser | pass | pass | pass | pass |
| flights in a world > a touches that throws: the kept answer goes on a move, a landing fails its callers | Unit, Browser | pass | pass | pass | pass |
| flights in a world > an answer whose world moved on its way is STALE for every joiner, and not kept | Unit, Browser | pass | pass | pass | pass |
| flights in a world > takes only a world made by world() | Unit, Browser | pass | pass | pass | pass |