Download superlog/apps/api/src/boot-migrations.test.ts from smlflg/Experimente: direct link, hf CLI and curl.
- Browser
- Download file 841 Bytes
-
https://huggingface.co/smlflg/Experimente/resolve/main/superlog/apps/api/src/boot-migrations.test.ts
- Command line
-
hf download hf://smlflg/Experimente/superlog/apps/api/src/boot-migrations.test.ts
-
curl -L -o boot-migrations.test.ts https://huggingface.co/smlflg/Experimente/resolve/main/superlog/apps/api/src/boot-migrations.test.ts
841 Bytes
| import assert from "node:assert/strict"; | |
| import { test } from "node:test"; | |
| import { shouldRunMigrationsOnBoot } from "./boot-migrations.js"; | |
| test("defaults to running migrations on boot when unset", () => { | |
| assert.equal(shouldRunMigrationsOnBoot({} as NodeJS.ProcessEnv), true); | |
| }); | |
| test("runs on boot when explicitly enabled", () => { | |
| assert.equal( | |
| shouldRunMigrationsOnBoot({ RUN_MIGRATIONS_ON_BOOT: "true" } as NodeJS.ProcessEnv), | |
| true, | |
| ); | |
| }); | |
| test("skips boot migrations only when explicitly set to 'false'", () => { | |
| assert.equal( | |
| shouldRunMigrationsOnBoot({ RUN_MIGRATIONS_ON_BOOT: "false" } as NodeJS.ProcessEnv), | |
| false, | |
| ); | |
| }); | |
| test("any non-'false' value still runs on boot", () => { | |
| assert.equal( | |
| shouldRunMigrationsOnBoot({ RUN_MIGRATIONS_ON_BOOT: "0" } as NodeJS.ProcessEnv), | |
| true, | |
| ); | |
| }); | |