tcmts.cli.test.e2e.sync

Types

Keep type
What withChildren hands a test: keeps a process, to kill when the test ends.

Server

codebase (root: string, name: string) => { dir: string; tcm: (...args: string[]) => string; scratch: (text: …
startServerInfo (keep: Keep, dir: string, token: string, ...extra: string[]) => Promise<{ url: string; fingerprint?…

Shared

startServer (keep: Keep, dir: string, token: string, ...extra: string[]) => Promise<string>
Start `tcm serve` on a free port; resolves to its base URL (and certificate fingerprint with --tls).

Tests

testBigPushesTravelCompressed () => Promise<void>
A big push goes compressed to a server that says it takes compressed bodies (and small requests, and those before it has said so, as they are); a compressed body is held to the server's size limit unpacked.
testCommentChangesTravel () => void
A change to only a definition's doc and comments travels like any: pushed, the remote reads it so; pulled, by a codebase that lacks the code and by one that has it already. Each text received is checked to be the same code.
testFilesTravel () => void
files kept as written (a page linking to code, an image) are history like code: pushed and pulled with it, and with code that imports them
testHistoryFromBeforeTheLibrariesTravels () => Promise<void>
A codebase whose history predates the server library (`tcmts.fixtures.codebase-tcm-server`: its first version imported `#tcm/server`, as `tcm:server`) pushes to a server running this tcm, and is pulled from it: history's definitions are checked by re-hashing as they were, though nothing new can import `#tcm/server`.
testParallelChecksMatchOneAtATime () => Promise<void>
Checking what's received in several checker processes at once stores what checking it in one does, and still rejects tampered source among many.
testPullPushDivergence () => void
pull, push and divergence between codebase directories
testReceivedConstantsArentRun () => Promise<void>
Nothing received is run while it's checked, not even a pure constant whose value tcm would keep where it runs it (TCM_DEBUG says when it evaluates some): a constant that never finished computing couldn't hold a server up.
testReceivedSignaturesFollowRenames () => Promise<void>
A received term's signature names a type as it's called now after a rename, though only its inferred type mentions it: receiving leaves type shapes out, and they're worked out for what the branch comes to name.
testResultsTravel () => void
Tests' results travel with the code: pulled, a codebase has them, so its tests don't run again (a test's hash covers what it runs); pushed, the other side has what ran here.
testResultsTravelThroughAServer () => Promise<void>
Tests' results and lint findings travel through a server too: pushed with the code, and pulled from it by a codebase that hasn't run or linted it.
testServeRunOn () => Promise<void>
tcm serve: run --on sends missing code, streams output, and rejects tampered definitions (or keeps none of what they claim)
testServeSite () => Promise<void>
tcm serve --site: a static site to anyone, beside the codebase's routes (which still need the token); a token that was given isn't printed; a directory asked without its slash goes to it with one, and with --moved, a page that moved under a path is redirected there
testServeTlsPinning () => Promise<void>
tcm serve --tls: clients pin the certificate and never send the token to an impostor