Skip to content
This repository was archived by the owner on May 17, 2025. It is now read-only.

Commit e38d88b

Browse files
committed
reenable tests
1 parent 3d49579 commit e38d88b

File tree

1 file changed

+65
-65
lines changed

1 file changed

+65
-65
lines changed

test/api/update.test.js

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
11
import { Generator, lookup } from "@jspm/generator";
22
import assert from "assert";
33

4-
// {
5-
// const generator = new Generator({
6-
// inputMap: {
7-
// imports: {
8-
// react: "https://ga.jspm.io/npm:react@17.0.1/dev.index.js",
9-
// },
10-
// scopes: {
11-
// "https://ga.jspm.io/": {
12-
// "object-assign":
13-
// "https://ga.jspm.io/npm:object-assign@4.1.0/index.js",
14-
// },
15-
// },
16-
// },
17-
// mapUrl: import.meta.url,
18-
// defaultProvider: "jspm.io",
19-
// env: ["production", "browser"],
20-
// });
4+
{
5+
const generator = new Generator({
6+
inputMap: {
7+
imports: {
8+
react: "https://ga.jspm.io/npm:react@17.0.1/dev.index.js",
9+
},
10+
scopes: {
11+
"https://ga.jspm.io/": {
12+
"object-assign":
13+
"https://ga.jspm.io/npm:object-assign@4.1.0/index.js",
14+
},
15+
},
16+
},
17+
mapUrl: import.meta.url,
18+
defaultProvider: "jspm.io",
19+
env: ["production", "browser"],
20+
});
2121

22-
// await generator.update("react");
23-
// const json = generator.getMap();
22+
await generator.update("react");
23+
const json = generator.getMap();
2424

25-
// assert.strictEqual(
26-
// json.imports.react,
27-
// "https://ga.jspm.io/npm:react@17.0.2/index.js"
28-
// );
29-
// assert.strictEqual(
30-
// json.scopes["https://ga.jspm.io/"]["object-assign"],
31-
// "https://ga.jspm.io/npm:object-assign@4.1.1/index.js"
32-
// );
33-
// assert.strictEqual(Object.keys(json.imports).length, 1);
34-
// assert.strictEqual(Object.keys(json.scopes["https://ga.jspm.io/"]).length, 1);
35-
// }
25+
assert.strictEqual(
26+
json.imports.react,
27+
"https://ga.jspm.io/npm:react@17.0.2/index.js"
28+
);
29+
assert.strictEqual(
30+
json.scopes["https://ga.jspm.io/"]["object-assign"],
31+
"https://ga.jspm.io/npm:object-assign@4.1.1/index.js"
32+
);
33+
assert.strictEqual(Object.keys(json.imports).length, 1);
34+
assert.strictEqual(Object.keys(json.scopes["https://ga.jspm.io/"]).length, 1);
35+
}
3636

37-
// {
38-
// const generator = new Generator({
39-
// inputMap: {
40-
// imports: {
41-
// lit: "https://ga.jspm.io/npm:lit@2.2.4/index.js",
42-
// "lit/directive.js": "https://ga.jspm.io/npm:lit@2.2.4/directive.js",
43-
// },
44-
// scopes: {
45-
// "https://ga.jspm.io/": {
46-
// "@lit/reactive-element":
47-
// "https://ga.jspm.io/npm:@lit/reactive-element@1.3.4/reactive-element.js",
48-
// "lit-element/lit-element.js":
49-
// "https://ga.jspm.io/npm:lit-element@3.2.2/lit-element.js",
50-
// "lit-html": "https://ga.jspm.io/npm:lit-html@2.2.7/lit-html.js",
51-
// "lit-html/directive.js":
52-
// "https://ga.jspm.io/npm:lit-html@2.2.7/directive.js",
53-
// },
54-
// },
55-
// },
56-
// mapUrl: import.meta.url,
57-
// defaultProvider: "jspm.io",
58-
// env: ["production", "browser"],
59-
// });
37+
{
38+
const generator = new Generator({
39+
inputMap: {
40+
imports: {
41+
lit: "https://ga.jspm.io/npm:lit@2.2.4/index.js",
42+
"lit/directive.js": "https://ga.jspm.io/npm:lit@2.2.4/directive.js",
43+
},
44+
scopes: {
45+
"https://ga.jspm.io/": {
46+
"@lit/reactive-element":
47+
"https://ga.jspm.io/npm:@lit/reactive-element@1.3.4/reactive-element.js",
48+
"lit-element/lit-element.js":
49+
"https://ga.jspm.io/npm:lit-element@3.2.2/lit-element.js",
50+
"lit-html": "https://ga.jspm.io/npm:lit-html@2.2.7/lit-html.js",
51+
"lit-html/directive.js":
52+
"https://ga.jspm.io/npm:lit-html@2.2.7/directive.js",
53+
},
54+
},
55+
},
56+
mapUrl: import.meta.url,
57+
defaultProvider: "jspm.io",
58+
env: ["production", "browser"],
59+
});
6060

61-
// await generator.update("lit");
62-
// const json = generator.getMap();
63-
// const expectedVersion = (await lookup("lit@2")).resolved.version;
61+
await generator.update("lit");
62+
const json = generator.getMap();
63+
const expectedVersion = (await lookup("lit@2")).resolved.version;
6464

65-
// assert.strictEqual(
66-
// json.imports.lit,
67-
// `https://ga.jspm.io/npm:lit@${expectedVersion}/index.js`
68-
// );
69-
// assert.strictEqual(
70-
// json.imports["lit/directive.js"],
71-
// `https://ga.jspm.io/npm:lit@${expectedVersion}/directive.js`
72-
// );
73-
// }
65+
assert.strictEqual(
66+
json.imports.lit,
67+
`https://ga.jspm.io/npm:lit@${expectedVersion}/index.js`
68+
);
69+
assert.strictEqual(
70+
json.imports["lit/directive.js"],
71+
`https://ga.jspm.io/npm:lit@${expectedVersion}/directive.js`
72+
);
73+
}
7474

7575
{
7676
const generator = new Generator({ defaultProvider: 'jsdelivr' });

0 commit comments

Comments
 (0)