-
-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46314f8
commit 868bea5
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/[email protected]/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<string, string>) => { | ||
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<string, string>) => { | ||
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); |