repository-provider-test-support 3.1.5 → 3.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/repository-list-test.mjs +26 -23
- package/types/util.d.mts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider-test-support",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.6",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"browser-stream-util": "^1.2.1",
|
|
39
|
-
"content-entry": "^11.0.
|
|
39
|
+
"content-entry": "^11.0.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"ava": "^6.1.3",
|
|
43
|
-
"c8": "^
|
|
43
|
+
"c8": "^10.1.2",
|
|
44
44
|
"documentation": "^14.0.3",
|
|
45
|
-
"repository-provider": "^35.2.
|
|
45
|
+
"repository-provider": "^35.2.21",
|
|
46
46
|
"semantic-release": "^24.0.0",
|
|
47
|
-
"typescript": "^5.
|
|
47
|
+
"typescript": "^5.5.3"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|
|
50
50
|
"node": ">=20.12.2"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export async function repositoryListTest(t, provider, pattern, expected) {
|
|
2
|
-
|
|
3
2
|
t.truthy(provider, "provider present");
|
|
4
3
|
|
|
5
4
|
const rs = {};
|
|
@@ -8,32 +7,36 @@ export async function repositoryListTest(t, provider, pattern, expected) {
|
|
|
8
7
|
rs[r.fullName] = r;
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
t.truthy(expected <= length, `expected at least ${expected} but got only ${length} entries for ${pattern}`);
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (expected === undefined) {
|
|
19
|
-
t.is(
|
|
20
|
-
Object.keys(rs).length,
|
|
21
|
-
0,
|
|
22
|
-
`there should not by any repository for \"${pattern}\"`
|
|
23
|
-
);
|
|
24
|
-
} else {
|
|
25
|
-
for (const [name, e] of Object.entries(expected)) {
|
|
26
|
-
const r = rs[name];
|
|
10
|
+
switch (typeof expected) {
|
|
11
|
+
case "number": {
|
|
12
|
+
const length = Object.keys(rs).length;
|
|
27
13
|
|
|
28
14
|
t.truthy(
|
|
29
|
-
|
|
30
|
-
`
|
|
15
|
+
expected <= length,
|
|
16
|
+
`expected at least ${expected} but got only ${length} entries for ${pattern}`
|
|
31
17
|
);
|
|
32
|
-
|
|
33
|
-
for (const key of Object.keys(e)) {
|
|
34
|
-
t.is(r[key], e[key], `${name}.${key}`);
|
|
35
|
-
}
|
|
18
|
+
return;
|
|
36
19
|
}
|
|
20
|
+
case "undefined":
|
|
21
|
+
t.is(
|
|
22
|
+
Object.keys(rs).length,
|
|
23
|
+
0,
|
|
24
|
+
`there should not by any repository for \"${pattern}\"`
|
|
25
|
+
);
|
|
26
|
+
break;
|
|
27
|
+
default:
|
|
28
|
+
for (const [name, e] of Object.entries(expected)) {
|
|
29
|
+
const r = rs[name];
|
|
30
|
+
|
|
31
|
+
t.truthy(
|
|
32
|
+
r !== undefined,
|
|
33
|
+
`missing expected repository ${name} in (${Object.keys(rs)})`
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
for (const key of Object.keys(e)) {
|
|
37
|
+
t.is(r[key], e[key], `${name}.${key}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
|
package/types/util.d.mts
CHANGED