repository-provider-test-support 3.1.4 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repository-provider-test-support",
3
- "version": "3.1.4",
3
+ "version": "3.1.6",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -24,29 +24,30 @@
24
24
  ],
25
25
  "license": "BSD-2-Clause",
26
26
  "scripts": {
27
- "prepare": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs",
27
+ "prepare": "npm run prepare:typescript",
28
+ "prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule -t esnext -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
28
29
  "test": "npm run test:ava",
29
30
  "test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
30
31
  "cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
31
32
  "docs": "documentation readme --section=API ./src/**/*.mjs",
32
- "lint": "npm run lint:docs && npm run lint:tsc",
33
+ "lint": "npm run lint:docs && npm run lint:typescript",
33
34
  "lint:docs": "documentation lint ./src/**/*.mjs",
34
- "lint:tsc": "tsc --allowJs --checkJs --noEmit -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
35
+ "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
35
36
  },
36
37
  "dependencies": {
37
- "browser-stream-util": "^1.2.0",
38
- "content-entry": "^9.0.0"
38
+ "browser-stream-util": "^1.2.1",
39
+ "content-entry": "^11.0.1"
39
40
  },
40
41
  "devDependencies": {
41
- "ava": "^6.1.1",
42
- "c8": "^9.1.0",
42
+ "ava": "^6.1.3",
43
+ "c8": "^10.1.2",
43
44
  "documentation": "^14.0.3",
44
- "repository-provider": "^35.2.14",
45
- "semantic-release": "^23.0.2",
46
- "typescript": "^5.3.3"
45
+ "repository-provider": "^35.2.21",
46
+ "semantic-release": "^24.0.0",
47
+ "typescript": "^5.5.3"
47
48
  },
48
49
  "engines": {
49
- "node": ">=20.11.1"
50
+ "node": ">=20.12.2"
50
51
  },
51
52
  "repository": {
52
53
  "type": "git",
@@ -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
- if (typeof expected === "number") {
12
- const length = Object.keys(rs).length;
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
- r !== undefined,
30
- `missing expected repository ${name} in (${Object.keys(rs)})`
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
@@ -9,4 +9,4 @@
9
9
  * @param {string} pattern
10
10
  */
11
11
  export function generateBranchName(repository: Repository, pattern: string): Promise<string>;
12
- export type Repository = import('repository-provider').Repository;
12
+ export type Repository = import("repository-provider").Repository;