From 868bea516c11e16f58bd8ccb3c1245fe2f5a48d0 Mon Sep 17 00:00:00 2001 From: Jaya Krishna Date: Fri, 22 Dec 2023 23:46:05 +0530 Subject: [PATCH] Skip install with freeze tests --- test/freeze.test.skip.ts | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 test/freeze.test.skip.ts diff --git a/test/freeze.test.skip.ts b/test/freeze.test.skip.ts new file mode 100644 index 000000000..c89903f53 --- /dev/null +++ b/test/freeze.test.skip.ts @@ -0,0 +1,39 @@ +import assert from "assert"; +import { type Scenario, runScenarios } from "./scenarios"; + +const importMap = new Map([ + [ + "importmap.json", + JSON.stringify({ + imports: { + fs: "https://ga.jspm.io/npm:@jspm/core@2.0.0-beta.20/nodelibs/node/fs.js", + }, + }), + ], +]); + +const scenarios: Scenario[] = [ + // Installing without freeze should bump the version of core: + { + files: importMap, + commands: ["jspm install node:process"], + validationFn: async (files: Map) => { + const map = JSON.parse(files.get("importmap.json")); + assert(!map.imports.fs.includes("2.0.0-beta.20")); + assert(!map.imports.process.includes("2.0.0-beta.20")); + }, + }, + + // Installing with freeze should keep it fixed: + { + files: importMap, + commands: ["jspm install node:process --freeze"], + validationFn: async (files: Map) => { + const map = JSON.parse(files.get("importmap.json")); + assert(map.imports.fs.includes("2.0.0-beta.20")); + assert(map.imports.process.includes("2.0.0-beta.20")); + }, + }, +]; + +runScenarios(scenarios);