setUp
uses node:fs
A new codebase, with no scratch file: its directory, a way to run tcm in it and to write its scratch file.
import { okIn, tempDir } from "#codebase/tcmts/cli/test/e2e/harness"; import fs from "node:fs"; import path from "node:path"; export function setUp() { const dir = tempDir("prod"); const tcm = (...args: string[]) => okIn(dir, ...args); const scratch = (text: string) => fs.writeFileSync(path.join(dir, "scratch.ts"), text); tcm("init"); fs.rmSync(path.join(dir, "scratch.ts")); return { dir, tcm, scratch }; }
uses
used by
- tcmts.cli.test.e2e.prod.testAssetsKeepTheirUrlsAcrossDeploys
- tcmts.cli.test.e2e.prod.testBuildDuringStart
- tcmts.cli.test.e2e.prod.testBuildStartDeployRollBack
- tcmts.cli.test.e2e.prod.testBuildsByAnotherTcmAreMadeAgain
- tcmts.cli.test.e2e.prod.testBuildsOfOneAppAtOnce
- tcmts.cli.test.e2e.prod.testBundlesHoldOnlyWhatTheAppReaches
- tcmts.cli.test.e2e.prod.testDeployedChunksArriveAsDifferences
- tcmts.cli.test.e2e.prod.testKeptBuildWithoutItsCode
- tcmts.cli.test.e2e.prod.testModuleStatePlacement
- tcmts.cli.test.e2e.prod.testStaticSitesAndPwas
- tcmts.cli.test.e2e.suites.testBuildsWaitForASlot