Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/util/compute-images.test.ts
Views: 687
import { FALLBACK_SOFTWARE_ENV } from "./compute-images";12test("fallback name exists", () => {3expect(4FALLBACK_SOFTWARE_ENV.environments[FALLBACK_SOFTWARE_ENV.default]5).toBeDefined();6});78test("consistent naming", () => {9const envs = FALLBACK_SOFTWARE_ENV.environments;10const groups = FALLBACK_SOFTWARE_ENV.groups;11for (const [name, info] of Object.entries(envs)) {12const i = name.indexOf("-");13const [base, ts] =14i > 0 ? [name.slice(0, i), name.slice(i + 1)] : [name, ""];15expect(info.title).toBeDefined();16expect(groups.includes(info.group)).toBe(true);17const { group, title, short } = info;1819expect(short).toBeDefined();20switch (group) {21case "Main":22expect(23["default", "ubuntu2004", "ubuntu2204", "ubuntu1804"].includes(base)24).toBe(true);25break;2627case "Ubuntu 16.04":28expect(["old"].includes(base)).toBe(true);29expect(title?.indexOf(ts) ?? 0 > 0);30break;3132case "Ubuntu 18.04":33expect(["exp", "stable", "previous"].includes(base)).toBe(true);34expect(title?.indexOf(ts) ?? 0 > 0);35if (base === "stable") {36expect(ts.startsWith(short ?? "")).toBe(true);37}38break;3940case "Ubuntu 20.04":41expect(["ubuntu2004", "exp"].includes(base)).toBe(true);42expect(title?.indexOf(ts) ?? 0 > 0);43if (ts === "dev" || ts === "previous") {44} else if (base === "ubuntu2004") {45expect(ts.startsWith(short ?? "")).toBe(true);46}47break;4849case "Ubuntu 22.04":50expect(["ubuntu2204", "exp"].includes(base)).toBe(true);51expect(title?.indexOf(ts) ?? 0 > 0);52if (ts === "dev" || ts === "previous") {53} else if (base === "ubuntu2204") {54expect(ts.startsWith(short ?? "")).toBe(true);55}56break;5758default:59expect(60["stable", "old", "exp", "previous", "default", ""].includes(base)61).toBe(true);62}63}64});656667