Tests / @ogygia/machine

@ogygia/machine

Version 0.13.1
commit 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

TestKindNodeChromiumFirefoxWebKit
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 takenUnit, Browserpasspasspasspass
after: a state that ends on its own > a move out first cancels it: no late step, no timer leftUnit, Browserpasspasspasspass
after: a state that ends on its own > a state with no `after` costs no timerUnit, Browserpasspasspasspass
after: a state that ends on its own > a step to itself is a new visit tooUnit, Browserpasspasspasspass
after: a state that ends on its own > a time made from the state’s value: the retry waits longer each attemptUnit, Browserpasspasspasspass
after: a state that ends on its own > a timed step that fails (its data throws) is reported; the machine stays where it isUnit, Browserpasspasspasspass
after: a state that ends on its own > an initial state with a timeout starts its time when the machine is madeUnit, Browserpasspasspasspass
after: a state that ends on its own > an observer that moves the machine during the timed step leaves no stray timerUnit, Browserpasspasspasspass
after: a state that ends on its own > coming back starts the time again (the old visit’s time never fires)Unit, Browserpasspasspasspass
after: a state that ends on its own > still in the state when its time is up: the machine takes the step, with its dataUnit, Browserpasspasspasspass
after: a state that ends on its own > stop() cancels itUnit, Browserpasspasspasspass
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 itUnit, Browserpasspasspasspass
after: refused definitions > a state that is not a stateUnit, Browserpasspasspasspass
after: refused definitions > a target that is not one of the state’s stepsUnit, Browserpasspasspasspass
after: refused definitions > a time made from the state that is not a time: reported, and the state does not end at onceUnit, Browserpasspasspasspass
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, Browserpasspasspasspass
after: refused definitions > the longest time a timer holds is acceptedUnit, Browserpasspasspasspass
packages/machine/test/flights.test.ts
fresh > a fresh flight ends the one already out: its callers get STALEUnit, Browserpasspasspasspass
fresh > a fresh flight over one whose callers have signals: they get STALE, and their leaving later stops nothingUnit, Browserpasspasspasspass
fresh > a refresh that fails, or answers what is not kept, leaves the kept answer in placeUnit, Browserpasspasspasspass
fresh > starts a new flight beside the kept answer, which stays until the new one landsUnit, Browserpasspasspasspass
fresh > the last caller of a refresh leaving puts the kept answer backUnit, Browserpasspasspasspass
keep, max and weigh > `keep` made from the answer: 0 keeps nothing (callers share the flight while it is out)Unit, Browserpasspasspasspass
keep, max and weigh > `max` counts answers: past it the least recently used goes firstUnit, Browserpasspasspasspass
keep, max and weigh > `weigh` puts each answer against `max`; one heavier than all of `max` is not keptUnit, Browserpasspasspasspass
keep, max and weigh > a keep or weigh that throws fails the flight and keeps nothingUnit, Browserpasspasspasspass
keep, max and weigh > a refresh out keeps its prior against `max` until it lands; nothing kept passes `max` afterUnit, Browserpasspasspasspass
keep, max and weigh > a weight below 0 or not a number is not kept, so `max` still caps (#355)#355Unit, Browserpasspasspasspass
keep, max and weigh > an expired answer goes before a live one is pushed out (#356)#356Unit, Browserpasspasspasspass
keep, max and weigh > an expired answer is swept out when a new flight startsUnit, Browserpasspasspasspass
keep, max and weigh > keeps an answer for `keep` ms, real time, then runs againUnit, Browserpasspasspasspass
keyed > `key` names the fields that are one flight; the input that started it is the one that runsUnit, Browserpasspasspasspass
keyed > a caller that leaves gets STALE at once; the work stops only when the last one has leftUnit, Browserpasspasspasspass
keyed > a caller whose signal already aborted gets STALE and starts nothingUnit, Browserpasspasspasspass
keyed > a caller with no signal holds the flight: the others leaving does not stop itUnit, Browserpasspasspasspass
keyed > a drop ends the flight out: every caller gets STALE, its signal aborts, nothing is keptUnit, Browserpasspasspasspass
keyed > a drop predicate that gets or drops as it is asked: every key is asked once, every caller settlesUnit, Browserpasspasspasspass
keyed > a failure that lands after a drop is STALE, not a failure, for the callers of that flightUnit, Browserpasspasspasspass
keyed > a kept answer reaches a caller with a signal tooUnit, Browserpasspasspasspass
keyed > a key field compares objects by identity, and keeps every kind of value apartUnit, Browserpasspasspasspass
keyed > a keyed flights refuses a key it cannot use, where it is writtenUnit, Browserpasspasspasspass
keyed > a missing key field and one that is undefined are one key; a registered symbol is one by its nameUnit, Browserpasspasspasspass
keyed > a run that gets its own key before it returns joins its own flight (#354)#354Unit, Browserpasspasspasspass
keyed > drop by key fields, or by a predicate over them (never over the rest of the input)Unit, Browserpasspasspasspass
keyed > drop takes a predicate, over kept answers and flights out alikeUnit, Browserpasspasspasspass
keyed > one flight per key: the same key joins, another key runs on its ownUnit, Browserpasspasspasspass
keyed > runs inside the get that starts it, with a signal of its ownUnit, Browserpasspasspasspass
keyed > two inputs that differ in any key field never share an answerUnit, Browserpasspasspasspass
one key (what once() was) > a deadline aborts the try out and fails with a TimeoutErrorUnit, Browserpasspasspasspass
one key (what once() was) > a drop during the wait between tries ends them: STALE, no next tryUnit, Browserpasspasspasspass
one key (what once() was) > a run that throws synchronously is a failure tooUnit, Browserpasspasspasspass
one key (what once() was) > callers while it runs share the one run, and the same promiseUnit, Browserpasspasspasspass
one key (what once() was) > every caller of a failed run gets the failure, then the next get starts freshUnit, Browserpasspasspasspass
one key (what once() was) > gives the last failure when its tries run outUnit, Browserpasspasspasspass
one key (what once() was) > its own handling of a failure adds no unhandled rejectionUnit, Browserpasspasspasspass
one key (what once() was) > never keeps a failure: the next get runs againUnit, Browserpasspasspasspass
one key (what once() was) > refuses options it cannot takeUnit, Browserpasspasspasspass
one key (what once() was) > runs on the first get and keeps the answerUnit, Browserpasspasspasspass
one key (what once() was) > takes a plain valueUnit, Browserpasspasspasspass
one key (what once() was) > tries again at once before it fails, within the turn: no timer between triesUnit, Browserpasspasspasspass
one key (what once() was) > waits between tries as its policy says, real timersUnit, Browserpasspasspasspass
owned > a disposed flights drops everything and runs nothing afterUnit, Browserpasspasspasspass
owned > a scope adopts it: closing the scope ends its flightsUnit, Browserpasspasspasspass
under load (real concurrency) > random gets, leaves, drops and answers: one run per flight, every caller settles, nothing failed is keptUnit, Browserpasspasspasspass
packages/machine/test/graph.test.ts
graph() > every state, its steps, whether it is final, and its own timeoutUnit, Browserpasspasspasspass
graph() > is plain data: it survives JSON (devtools send it over the wire)Unit, Browserpasspasspasspass
paths() > between them they take every step of the definitionUnit, Browserpasspasspasspass
paths() > every path can be driven: each move along it is allowedUnit, Browserpasspasspasspass
paths() > one path per step, each the shortest that reaches its state and takes itUnit, Browserpasspasspasspass
packages/machine/test/lock.test.ts
lock > a free lock refuses any freeUnit, Browserpasspasspasspass
lock > acquire: an abort after its turn changes nothingUnit, Browserpasspasspasspass
lock > acquire: an abort before its turn leaves the queue and rejects with the reasonUnit, Browserpasspasspasspass
lock > acquire: an already aborted signal rejects at once and never takes itUnit, Browserpasspasspasspass
lock > acquire: at once when freeUnit, Browserpasspasspasspass
lock > acquire: waits its turn, first come first served, handed straight onUnit, Browserpasspasspasspass
lock > every take gets a new tokenUnit, Browserpasspasspasspass
lock > freeing twice does nothing the second timeUnit, Browserpasspasspasspass
lock > only the token that holds it frees itUnit, Browserpasspasspasspass
lock > random runs agree with a model: one owner, exact held, first come first servedUnit, Browserpasspasspasspass
lock > seize: takes it from a stuck owner, whose late free is then refusedUnit, Browserpasspasspasspass
lock > take: one owner at a timeUnit, Browserpasspasspasspass
packages/machine/test/machine.test.ts
definition > a one-state machine works (initial, final)Unit, Browserpasspasspasspass
definition > copies the steps: changing the object it was given changes nothingUnit, Browserpasspasspasspass
definition > keeps its name, initial and steps, frozenUnit, Browserpasspasspasspass
definition > names its error: a MachineError with the code and its pageUnit, Browserpasspasspasspass
definition > refuses a state that can never be reachedUnit, Browserpasspasspasspass
definition > refuses a step listed twiceUnit, Browserpasspasspasspass
definition > refuses a step to a state that is not a stateUnit, Browserpasspasspasspass
definition > refuses an initial state that is not a stateUnit, Browserpasspasspasspass
definition > starts in an initial state that carries dataUnit, Browserpasspasspasspass
definition > treats state names like Object.prototype keys as plain namesUnit, Browserpasspasspasspass
go > a final state goes nowhereUnit, Browserpasspasspasspass
go > a state can step to itself (a fresh visit)Unit, Browserpasspasspasspass
go > moves along a step and says soUnit, Browserpasspasspasspass
go > throws in dev for a move the steps do not allow, and stays putUnit, Browserpasspasspasspass
machines are independent > machines of different definitions do not mixUnit, Browserpasspasspasspass
machines are independent > the STALE symbol is the same across copies of the packageUnit, Browserpasspasspasspass
machines are independent > two machines of one definition share nothingUnit, Browserpasspasspasspass
move > moves when the machine is still in fromUnit, Browserpasspasspasspass
move > refuses quietly when something else moved it firstUnit, Browserpasspasspasspass
move > throws in dev for a step that does not exist, even when not in fromUnit, Browserpasspasspasspass
now > a dataless state entered with {} is still that stateUnit, Browserpasspasspasspass
now > a dataless step to itself is a new visit tooUnit, Browserpasspasspasspass
now > carries the data of the state it is in, frozen in devUnit, Browserpasspasspasspass
now > copies the data: changing the object passed in changes nothingUnit, Browserpasspasspasspass
now > is a new value on every visit, with no data too: a saved now tells the visits apartUnit, Browserpasspasspasspass
now > is the same value for as long as the visit lastsUnit, Browserpasspasspasspass
now > refuses data with its own kindUnit, Browserpasspasspasspass
now > starts in initial, a value of its own, frozen in devUnit, Browserpasspasspasspass
observe > an observer that moves the machine again sees both moves in orderUnit, Browserpasspasspasspass
observe > an observer that throws does not break the move or the other observersUnit, Browserpasspasspasspass
observe > an observer that unsubscribes itself mid-move does not skip the next oneUnit, Browserpasspasspasspass
observe > hears every move and the stop, with the machineUnit, Browserpasspasspasspass
observe > hears nothing for a refused moveUnit, Browserpasspasspasspass
observe > stops hearing once it unsubscribesUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > a cleanup that moves the machine again works, and the next visit starts cleanUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > a refused move runs no cleanupUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > belongs to the visit it was added inUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > one that throws does not stop the others or the move; the move throws afterUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > runs at once on a stopped machineUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > runs once when the machine leaves, newest firstUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > sees the new state already in placeUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > several that throw come back togetherUnit, Browserpasspasspasspass
scope.defer: cleanups of one visit > the signal aborts before the cleanups runUnit, Browserpasspasspasspass
scope.task: work of one visit > a move with no task makes no abort controllerUnit, Browserpasspasspasspass
scope.task: work of one visit > a stopped machine does not run workUnit, Browserpasspasspasspass
scope.task: work of one visit > drops an answer that lands after the machine leftUnit, Browserpasspasspasspass
scope.task: work of one visit > drops it even when the machine came back to the same state (a new visit)Unit, Browserpasspasspasspass
scope.task: work of one visit > drops it on a step to itself tooUnit, Browserpasspasspasspass
scope.task: work of one visit > gives the answer while the machine stays putUnit, Browserpasspasspasspass
scope.task: work of one visit > passes a live signal, aborted once the machine leavesUnit, Browserpasspasspasspass
scope.task: work of one visit > rejects with the failure while the machine stays putUnit, Browserpasspasspasspass
scope.task: work of one visit > settles with STALE the moment the machine leaves, even when work never finishesUnit, Browserpasspasspasspass
scope.task: work of one visit > takes a plain value tooUnit, Browserpasspasspasspass
scope.task: work of one visit > tasks of one visit share one signal; the next visit gets a new oneUnit, Browserpasspasspasspass
scope.task: work of one visit > turns a failure after the machine left into STALE (no unhandled error)Unit, Browserpasspasspasspass
scope.task: work of one visit > turns a synchronous throw into a rejectionUnit, Browserpasspasspasspass
scope.task: work of one visit > work that ignores its signal and answers late still gives STALE onceUnit, Browserpasspasspasspass
scope.task: work of one visit > work that moves the machine itself gives STALEUnit, Browserpasspasspasspass
stop > a cleanup that throws on stop still runs the rest, then throwsUnit, Browserpasspasspasspass
stop > aborts tasks, runs cleanups, settles waits, refuses moves quietlyUnit, Browserpasspasspasspass
stop > twice is the same as onceUnit, Browserpasspasspasspass
wait > gives STALE as soon as the state cannot be reached any moreUnit, Browserpasspasspasspass
wait > gives STALE at once when the state is out of reach alreadyUnit, Browserpasspasspasspass
wait > many waits on many states settle each in turnUnit, Browserpasspasspasspass
wait > settles at once when the machine is in the stateUnit, Browserpasspasspasspass
wait > settles with the state it entered, even if the machine moved on sinceUnit, Browserpasspasspasspass
wait > settles with the state when the machine gets thereUnit, Browserpasspasspasspass
wait > stop settles every wait with STALEUnit, Browserpasspasspasspass
wait > throws in dev for a state that does not existUnit, Browserpasspasspasspass
packages/machine/test/mailbox.test.ts
mailbox > a handler that never settles holds the box until its owner closesUnit, Browserpasspasspasspass
mailbox > a handler waiting on two things at once lets one event in, not two at once (#341)#341Unit, Browserpasspasspasspass
mailbox > a timer of a handler that waits after its turn ended takes nobody’s turn (#341)#341Unit, Browserpasspasspasspass
mailbox > a wait from a handler whose turn already ended ends nobody’s turn (#341)#341Unit, Browserpasspasspasspass
mailbox > a wait from outside any turn ends nobody’s turn (#341)#341Unit, Browserpasspasspasspass
mailbox > a wait whose work settled while another handler held the turn hears STALE when the box closesUnit, Browserpasspasspasspass
mailbox > an ask whose handler waits, then sees its element leave: STALE for the asker tooUnit, Browserpasspasspasspass
mailbox > ask() gives the handler’s value, sync or async, in its turnUnit, Browserpasspasspasspass
mailbox > ends with its owner: queued events are dropped, a wait is STALE at once, later posts tooUnit, Browserpasspasspasspass
mailbox > gives a handler coming back from its wait no turn while another holds oneUnit, Browserpasspasspasspass
mailbox > holds the turn across a plain await: nothing else runs until the handler is backUnit, Browserpasspasspasspass
mailbox > is closed for an owner already closedUnit, Browserpasspasspasspass
mailbox > lets the next event in while a handler waits, and gives it its turn back behind itUnit, Browserpasspasspasspass
mailbox > reports a queued handler that throws, and goes on with the nextUnit, Browserpasspasspasspass
mailbox > runs a long run of sync events queued in one turn, on a flat stack (#342)#342Unit, Browserpasspasspasspass
mailbox > runs an event posted during a turn after it, never inside itUnit, Browserpasspasspasspass
mailbox > runs an event posted to an idle box at once, on the caller’s stackUnit, Browserpasspasspasspass
mailbox > runs events in the order they were posted, across waitsUnit, Browserpasspasspasspass
mailbox > tells an asker whose event was dropped STALEUnit, Browserpasspasspasspass
mailbox > throws a handler’s failure to its asker, and a wait’s rejection back in the turnUnit, Browserpasspasspasspass
mailbox > throws a sync failure to its poster when it runs at onceUnit, Browserpasspasspasspass
mailbox > with no page error handler, a queued handler’s throw follows its codeUnit, Browserpasspasspasspass
mailbox > work that settles after the box closed changes nothing: the box stays closed and idleUnit, Browserpasspasspasspass
packages/machine/test/outbox.test.ts
id > a put of an id still out joins it: one sendUnit, Browserpasspasspasspass
id > a receiver that failed to apply is tried again until it appliesUnit, Browserpasspasspasspass
id > done means applied: an answer lost after the apply is sent again, and the receiver drops the copyUnit, Browserpasspasspasspass
inOrder > a put of an id still queued joins it: one send, in its place in lineUnit, Browserpasspasspasspass
inOrder > one given up does not stop the ones after itUnit, Browserpasspasspasspass
inOrder > one send at a time, in put order, a failing one tried again before the next goesUnit, Browserpasspasspasspass
inOrder > sends go out together without itUnit, Browserpasspasspasspass
inOrder > the deadline counts from its own turn, not from the putUnit, Browserpasspasspasspass
inOrder > with none ahead, the send starts inside the put; behind one, once it endsUnit, Browserpasspasspasspass
policy > a list backs off by its entries (the last repeats); a number doublesUnit, Browserpasspasspasspass
policy > a wait is always a number of 0 to the timer limit: before the first try, and after very many (#359)#359Unit, Browserpasspasspasspass
policy > fills what it leaves out from the standard one, and is frozenUnit, Browserpasspasspasspass
policy > jitter cuts a wait by up to its shareUnit, Browserpasspasspasspass
policy > out of time before the next wait ends is a TimeoutError with the last error in it (#359)#359Unit, Browserpasspasspasspass
policy > refuses numbers it cannot use, where they are writtenUnit, Browserpasspasspasspass
policy > the caller leaving and the deadline in the same turn: whichever came first says how it endedUnit, Browserpasspasspasspass
policy > the outbox refuses a send that is not a functionUnit, Browserpasspasspasspass
put > a giveUp that throws is printed with the codeUnit, Browserpasspasspasspass
put > a send that throws before it returns is a failed try like any otherUnit, Browserpasspasspasspass
put > an id that is not a string or a finite number names nothing: not sent, said, false (#350)#350Unit, Browserpasspasspasspass
put > an id that throws: not sent, said, and put still never throwsUnit, Browserpasspasspasspass
put > gives up at once when the next wait would end past the deadlineUnit, Browserpasspasspasspass
put > ids 1 and "1" are two sendsUnit, Browserpasspasspasspass
put > out of tries: giveUp hears the last error once, and the put resolves falseUnit, Browserpasspasspasspass
put > returns at once, never throws, and resolves true once the send is doneUnit, Browserpasspasspasspass
put > the deadline aborts the try still out, and no try starts after itUnit, Browserpasspasspasspass
put > tries a failed send again after its backoff, until one is doneUnit, Browserpasspasspasspass
put > with no giveUp, a send given up is printed once with its codeUnit, Browserpasspasspasspass
waitUntil > a platform that refuses it does not stop the send, and put does not throwUnit, Browserpasspasspasspass
waitUntil > is handed each send, which settles when the send endsUnit, Browserpasspasspasspass
waitUntil > puts that join one send each hand it over, and each settles when that one send endsUnit, Browserpasspasspasspass
packages/machine/test/process.node.test.ts
a Node process > collects a flights nobody holds, and its world forgets it (#352)#352Unitpassnot runnot runnot run
a Node process > frees a symbol a keyed flights spelled into a key, once nothing holds it (#357)#357Unitpassnot runnot runnot run
a Node process > stays alive through the wait between two tries of a send (#351)#351Unitpassnot runnot runnot run
packages/machine/test/production.test.ts
production > a saved now still tells two visits to one dataless state apartUnit, Browserpasspasspasspass
production > a step to a state that does not exist is skipped by wait() and paths() too, not a throw (#358)#358Unit, Browserpasspasspasspass
production > does not freeze data values (a production build skips the dev-only copy checks)Unit, Browserpasspasspasspass
production > prints again for a different wrong moveUnit, Browserpasspasspasspass
production > refuses a wrong move: false, stays put, prints the link onceUnit, Browserpasspasspasspass
production > skips the definition checks but still refuses an initial that is not a stateUnit, Browserpasspasspasspass
production > wait for a state that does not exist is STALE, not a throwUnit, Browserpasspasspasspass
packages/machine/test/random.test.ts
random runs agree with the model > 2000 seeds × 120 stepsUnit, Browserpasspasspasspass
packages/machine/test/scope.test.ts
a machine visit is a scope > a move that throws from its cleanups names the machineUnit, Browserpasspasspasspass
a machine visit is a scope > a stopped machine’s scope is closed: work does not run, cleanups run at onceUnit, Browserpasspasspasspass
a machine visit is a scope > a visit nothing hangs work on makes no scopeUnit, Browserpasspasspasspass
a machine visit is a scope > one scope per visit: the same through the visit, closed by leaving, a new one next timeUnit, Browserpasspasspasspass
a machine visit is a scope > what a visit holds is let go when the machine leaves: listeners, timers, observersUnit, Browserpasspasspasspass
children > a child can close sooner on its own, and the parent then lets go of itUnit, Browserpasspasspasspass
children > a cleanup that gives the closing scope more work gets the closed behaviourUnit, Browserpasspasspasspass
children > a closed scope’s child is closedUnit, Browserpasspasspasspass
children > close before the parent’s own cleanups, newest firstUnit, Browserpasspasspasspass
children > what a child throws is thrown by the parent’s close, after its own cleanups ranUnit, Browserpasspasspasspass
close > a cleanup given to a closed scope runs at onceUnit, Browserpasspasspasspass
close > a cleanup that throws does not stop the others; close throws it after all have runUnit, Browserpasspasspasspass
close > a release that throws does not stop the other releases or the cleanups (#346)#346Unit, Browserpasspasspasspass
close > is safe to call twice, and says it closedUnit, Browserpasspasspasspass
close > more than one throws: an AggregateError, newest firstUnit, Browserpasspasspasspass
close > runs cleanups once, newest firstUnit, Browserpasspasspasspass
close > works with `using`Unit, Browserpasspasspasspass
on > a closed scope does not listen at allUnit, Browserpasspasspasspass
on > a once listener that fired lets go of itself: a long-lived scope does not pile them up (#348)#348Unit, Browserpasspasspasspass
on > a real window listener is gone after closeUnit, Browserskippasspasspass
on > keeps the listener options (capture, once) and lets go early when askedUnit, Browserpasspasspasspass
on > listens on a Node-style emitter (on / off)Unit, Browserpasspasspasspass
on > listens on an event target until the scope closesUnit, Browserpasspasspasspass
signal > a child’s signal aborts before its parent’sUnit, Browserpasspasspasspass
signal > a scope nothing asks a signal of makes no abort controllerUnit, Browserpasspasspasspass
signal > aborts on close, before the cleanups runUnit, Browserpasspasspasspass
signal > is one signal for the scope’s life; a closed scope’s is already abortedUnit, Browserpasspasspasspass
task > a closed scope does not run workUnit, Browserpasspasspasspass
task > a failure while open rejects; a throw at once tooUnit, Browserpasspasspasspass
task > an answer or a failure after the scope closed is STALEUnit, Browserpasspasspasspass
task > gives the answer while the scope is openUnit, Browserpasspasspasspass
task > settles with STALE the moment the scope closes, even when work never finishesUnit, Browserpasspasspasspass
task > work that closes its own scope before it returns still settles with STALE (#349)#349Unit, Browserpasspasspasspass
timers > 'frame' and 'idle' run once (a frame, idle time, or the next task where there is none)Unit, Browserpasspasspasspass
timers > a closed scope sets no timerUnit, Browserpasspasspasspass
timers > a fired timeout lets go of itself: a long-lived scope does not pile them upUnit, Browserpasspasspasspass
timers > closing clears a timeout that has not run; its cancel does tooUnit, Browserpasspasspasspass
timers > every repeats until the scope closesUnit, Browserpasspasspasspass
timers > refuses a time a timer cannot holdUnit, Browserpasspasspasspass
timers > timeout runs once after its time, real timersUnit, Browserpasspasspasspass
watch and adopt > `await using` gets the errors of an async disposal; a plain close reports themUnit, Browserpasspasspasspass
watch and adopt > a real MutationObserver stops hearing changes after closeUnit, Browserskippasspasspass
watch and adopt > adopts what disposes itself, sync or asyncUnit, Browserpasspasspasspass
watch and adopt > an async disposal adopted by a closed scope runs at once, is said when it fails, and is not kept (#347)#347Unit, Browserpasspasspasspass
watch and adopt > disconnects an observer on close (at once on a closed scope)Unit, Browserpasspasspasspass
watch and adopt > disposes at once on a closed scopeUnit, Browserpasspasspasspass
watch and adopt > refuses what cannot dispose itselfUnit, Browserpasspasspasspass
packages/machine/test/stage.test.ts
a commit in progress > a commit that closes its owner and then throws still puts everything backUnit, Browserpasspasspasspass
a commit in progress > a commit that closes its owner keeps what it committed (#343)#343Unit, Browserpasspasspasspass
after the commit > a discard step given after a discard runs at onceUnit, Browserpasspasspasspass
after the commit > a discard step given after the commit is dropped, not run (#344)#344Unit, Browserpasspasspasspass
after the commit > a stage that committed or was discarded leaves nothing on its owner (#345)#345Unit, Browserpasspasspasspass
an owner that closes first > an owner already closed never buildsUnit, Browserpasspasspasspass
an owner that closes first > ready is STALE at once, and what the build made so far is given backUnit, Browserpasspasspasspass
an owner that closes first > the build’s signal aborts when the owner closesUnit, Browserpasspasspasspass
build and commit > a commit after the owner closed is refused, and the build is given backUnit, Browserpasspasspasspass
build and commit > a committed stage gives nothing back when its owner closesUnit, Browserpasspasspasspass
build and commit > builds off to the side, then switches in at onceUnit, Browserpasspasspasspass
failures > a build that throws gives back what it made, and ready rejectsUnit, Browserpasspasspasspass
failures > a commit that throws puts back what it changed, gives back the build, and throwsUnit, Browserpasspasspasspass
failures > a step that throws is said once, and the others still runUnit, Browserpasspasspasspass
failures > refuses a build or commit that is not a functionUnit, Browserpasspasspasspass
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)#378Unit, Browserpasspasspasspass
a stale part makes the whole wait stale (#378) > a fresh flight that answers STALE gives the kept answer back#378Unit, Browserpasspasspasspass
a stale part makes the whole wait stale (#378) > a machine visit’s scope.task#378Unit, Browserpasspasspasspass
a stale part makes the whole wait stale (#378) > a mailbox turn’s wait, an outside wait and an ask#378Unit, Browserpasspasspasspass
a stale part makes the whole wait stale (#378) > a STALE answer of its own: the wait is STALE, and nothing is kept (#377)#378Unit, Browserpasspasspasspass
a stale part makes the whole wait stale (#378) > scope.task#378Unit, Browserpasspasspasspass
a stale part makes the whole wait stale (#378) > stage().ready#378Unit, Browserpasspasspasspass
a stale part makes the whole wait stale (#378) > under_policy#378Unit, Browserpasspasspasspass
only one level deep, only arrays > an array with no STALE comes through as it isUnit, Browserpasspasspasspass
only one level deep, only arrays > objects and nested arrays are not scannedUnit, Browserpasspasspasspass
packages/machine/test/types.test.ts
types > a stale part makes the whole wait stale: past the check, no slot is Stale (#378)#378Unit, Browserpasspasspasspass
types > after: a timeout takes one of its state’s steps, with the data that state needsUnit, Browserpasspasspasspass
types > create takes the initial state data when it has someUnit, Browserpasspasspasspass
types > flights: one key takes no input, a keyed one its input, answers may be STALEUnit, Browserpasspasspasspass
types > go takes only states some step leads to, with their dataUnit, Browserpasspasspasspass
types > graph and paths name the statesUnit, Browserpasspasspasspass
types > lockUnit, Browserpasspasspasspass
types > move checks the step itselfUnit, Browserpasspasspasspass
types > now is a union that narrows on kindUnit, Browserpasspasspasspass
types > scope: listeners get the event their target namesUnit, Browserpasspasspasspass
types > task gives the answer or STALEUnit, Browserpasspasspasspass
types > the definition is checked as it is writtenUnit, Browserpasspasspasspass
types > wait gives that state or STALEUnit, Browserpasspasspasspass
packages/machine/test/world.test.ts
a world > a keyed world moves only what read the keys it movedUnit, Browserpasspasspasspass
a world > a stamp from the future is never freshUnit, Browserpasspasspasspass
a world > a stamp is fresh until the world moves, and only moves forwardUnit, Browserpasspasspasspass
a world > a whole move of a keyed world puts every stamp before it out of dateUnit, Browserpasspasspasspass
a world > an empty move moves nothingUnit, Browserpasspasspasspass
a world > one move of more than KEYS_KEPT keys folds into the floor: out of date for every key, never fresh by mistakeUnit, Browserpasspasspasspass
a world > past KEYS_KEPT keys, the oldest move folds into the floor: never fresh when it is notUnit, Browserpasspasspasspass
flights in a world > a disposed flights stops hearing its worldUnit, Browserpasspasspasspass
flights in a world > a keyed move drops the kept answers made from its keys, and only thoseUnit, Browserpasspasspasspass
flights in a world > a move drops the kept answers and ends the flights out: their callers get STALEUnit, Browserpasspasspasspass
flights in a world > a move of other keys keeps the flight out and its answer (#294)#294Unit, Browserpasspasspasspass
flights in a world > a refresh beside a kept answer: an answer made stale on the way leaves the kept oneUnit, Browserpasspasspasspass
flights in a world > a touches that throws: the kept answer goes on a move, a landing fails its callersUnit, Browserpasspasspasspass
flights in a world > an answer whose world moved on its way is STALE for every joiner, and not keptUnit, Browserpasspasspasspass
flights in a world > takes only a world made by world()Unit, Browserpasspasspasspass