Skip to content

Commit 1e742e6

Browse files
committed
fix: use a proper fixture
1 parent 27e560d commit 1e742e6

File tree

2 files changed

+46
-10
lines changed

2 files changed

+46
-10
lines changed
Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,48 @@
11
{
2+
"type": "npm",
3+
"name": "nano-stringify-object",
4+
"version": "0.0.0",
5+
"default": null,
26
"files": [
3-
{ "name": "dist/index.d.ts", "hash": "ghi", "size": 1200 },
4-
{ "name": "dist/index.js", "hash": "def", "size": 5700 },
5-
{ "name": "package.json", "hash": "abc", "size": 600 }
6-
]
7+
{
8+
"type": "directory",
9+
"name": "dist",
10+
"files": [
11+
{
12+
"type": "file",
13+
"name": "index.d.mts",
14+
"hash": "miLdJwbJG1quJbUdHplSpmv+/7F8rHZM+kVXXRdz9W0=",
15+
"size": 1192
16+
},
17+
{
18+
"type": "file",
19+
"name": "index.mjs",
20+
"hash": "jznEg84ts4a5VCzdpfQViYnTBWoREZeolfbHUVtAymA=",
21+
"size": 5731
22+
}
23+
]
24+
},
25+
{
26+
"type": "file",
27+
"name": "LICENSE",
28+
"hash": "GxzKussvQB30SBOW+2S33DnejHW8yBDc3jxk/WDXyzM=",
29+
"size": 1221
30+
},
31+
{
32+
"type": "file",
33+
"name": "package.json",
34+
"hash": "1Z382Cx0/ZycKM2TUBZlLWHt/RB/z00gOfwkt8WyPG4=",
35+
"size": 639
36+
},
37+
{
38+
"type": "file",
39+
"name": "README.md",
40+
"hash": "47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=",
41+
"size": 0
42+
}
43+
],
44+
"links": {
45+
"stats": "https://data.jsdelivr.com/v1/stats/packages/npm/nano-stringify-object@0.0.0",
46+
"entrypoints": "https://data.jsdelivr.com/v1/packages/npm/nano-stringify-object@0.0.0/entrypoints"
47+
}
748
}

test/fixtures/mock-routes.cjs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -425,12 +425,7 @@ function matchJsdelivrDataApi(urlString) {
425425

426426
const fixture = readFixture(`jsdelivr/${parsed.name}.json`)
427427
if (fixture) {
428-
return json({
429-
type: 'npm',
430-
name: parsed.name,
431-
version: parsed.version || 'latest',
432-
...fixture,
433-
})
428+
return json(fixture)
434429
}
435430

436431
return json({

0 commit comments

Comments
 (0)