repository-provider-test-support 3.0.6 → 3.1.1
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 +15 -7
- package/src/util.mjs +3 -1
- package/types/branch-list-test.d.mts +4 -0
- package/types/branch-test.d.mts +1 -0
- package/types/constants.d.mts +8 -0
- package/types/entry-list-test.d.mts +1 -0
- package/types/group-test.d.mts +8 -0
- package/types/messages.d.mts +10 -0
- package/types/module.d.mts +16 -0
- package/types/provider-test.d.mts +12 -0
- package/types/pull-request-test.d.mts +2 -0
- package/types/repositories.d.mts +174 -0
- package/types/repository-list-test.d.mts +4 -0
- package/types/repository-owner-test.d.mts +8 -0
- package/types/repository-test.d.mts +5 -0
- package/types/tag-list-test.d.mts +4 -0
- package/types/util.d.mts +9 -0
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider-test-support",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
7
7
|
},
|
|
8
8
|
"exports": {
|
|
9
|
-
".":
|
|
9
|
+
".": {
|
|
10
|
+
"default": "./src/module.mjs",
|
|
11
|
+
"types": "./types/module.d.mts"
|
|
12
|
+
}
|
|
10
13
|
},
|
|
14
|
+
"types": "./types/module.d.mts",
|
|
11
15
|
"description": "test support for repository providers",
|
|
12
16
|
"keywords": [
|
|
13
17
|
"repository-provider"
|
|
@@ -20,12 +24,14 @@
|
|
|
20
24
|
],
|
|
21
25
|
"license": "BSD-2-Clause",
|
|
22
26
|
"scripts": {
|
|
27
|
+
"prepare": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs",
|
|
23
28
|
"test": "npm run test:ava",
|
|
24
29
|
"test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
|
|
25
30
|
"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",
|
|
26
31
|
"docs": "documentation readme --section=API ./src/**/*.mjs",
|
|
27
|
-
"lint": "npm run lint:docs",
|
|
28
|
-
"lint:docs": "documentation lint ./src/**/*.mjs"
|
|
32
|
+
"lint": "npm run lint:docs && npm run lint:tsc",
|
|
33
|
+
"lint:docs": "documentation lint ./src/**/*.mjs",
|
|
34
|
+
"lint:tsc": "tsc --allowJs --checkJs --noEmit -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
|
|
29
35
|
},
|
|
30
36
|
"dependencies": {
|
|
31
37
|
"browser-stream-util": "^1.2.0",
|
|
@@ -35,8 +41,9 @@
|
|
|
35
41
|
"ava": "^6.1.1",
|
|
36
42
|
"c8": "^9.1.0",
|
|
37
43
|
"documentation": "^14.0.3",
|
|
38
|
-
"repository-provider": "^35.2.
|
|
39
|
-
"semantic-release": "^23.0.2"
|
|
44
|
+
"repository-provider": "^35.2.9",
|
|
45
|
+
"semantic-release": "^23.0.2",
|
|
46
|
+
"typescript": "^5.3.3"
|
|
40
47
|
},
|
|
41
48
|
"engines": {
|
|
42
49
|
"node": ">=20.11.1"
|
|
@@ -52,7 +59,8 @@
|
|
|
52
59
|
"template": {
|
|
53
60
|
"inheritFrom": [
|
|
54
61
|
"arlac77/template-arlac77-github",
|
|
55
|
-
"arlac77/template-javascript-component"
|
|
62
|
+
"arlac77/template-javascript-component",
|
|
63
|
+
"arlac77/template-typescript"
|
|
56
64
|
]
|
|
57
65
|
}
|
|
58
66
|
}
|
package/src/util.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Repository } from "repository-provider";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* find a new branch name for a given pattern
|
|
3
5
|
* '*' will be replaced by a number
|
|
@@ -12,6 +14,6 @@ export async function generateBranchName(repository, pattern) {
|
|
|
12
14
|
n++;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
return pattern.replace(/\*/, n);
|
|
17
|
+
return pattern.replace(/\*/, String(n));
|
|
16
18
|
}
|
|
17
19
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function assertBranchUpdateAttributes(t: any, branch: any): Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const REPOSITORY_OWNER: "arlac77";
|
|
2
|
+
export const REPOSITORY_NAME: "arlac77/sync-test-repository";
|
|
3
|
+
export const REPOSITORY_NAME_GITHUB_HTTP: "https://github.com/arlac77/sync-test-repository.git";
|
|
4
|
+
export const REPOSITORY_NAME_GITHUB_GIT: "git@github.com:arlac77/sync-test-repository.git";
|
|
5
|
+
export const REPOSITORY_NAME_WITH_BRANCH: string;
|
|
6
|
+
export const REPOSITORY_NAME_WITH_BRANCH_GITHUB_HTTP: string;
|
|
7
|
+
export const REPOSITORY_NAME_WITH_BRANCH_GITHUB_GIT: string;
|
|
8
|
+
export const BITBUCKET_REPOSITORY_NAME: "arlac77/sync-test-repository";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function entryListTest(t: any, branch: any, pattern: any, entryFixtures: any): Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function groupListTest(t: any, provider: any, pattern: any, expected: any, withProviderName?: boolean): Promise<void>;
|
|
2
|
+
export namespace groupListTest {
|
|
3
|
+
function title(providedTitle: string, provider: any, pattern: any, expected: any): string;
|
|
4
|
+
}
|
|
5
|
+
export function groupTest(t: any, provider: any, name: any, expected: any): Promise<void>;
|
|
6
|
+
export namespace groupTest {
|
|
7
|
+
function title(providedTitle: string, provider: any, name: any, expected: any): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function assertBranch(t: any, branch: any, fixture: any, url: any): Promise<void>;
|
|
2
|
+
export function assertRepo(t: any, repository: any, fixture: any, url: any): Promise<void>;
|
|
3
|
+
export function assertCommit(t: any, repository: any, entryName?: string): Promise<void>;
|
|
4
|
+
export * from "./group-test.mjs";
|
|
5
|
+
export * from "./repository-list-test.mjs";
|
|
6
|
+
export * from "./repository-owner-test.mjs";
|
|
7
|
+
export * from "./branch-list-test.mjs";
|
|
8
|
+
export * from "./branch-test.mjs";
|
|
9
|
+
export * from "./tag-list-test.mjs";
|
|
10
|
+
export * from "./provider-test.mjs";
|
|
11
|
+
export * from "./repository-test.mjs";
|
|
12
|
+
export * from "./pull-request-test.mjs";
|
|
13
|
+
export * from "./entry-list-test.mjs";
|
|
14
|
+
export * from "./messages.mjs";
|
|
15
|
+
export * from "./repositories.mjs";
|
|
16
|
+
export * from "./constants.mjs";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function providerTest(t: any, provider: any): Promise<void>;
|
|
2
|
+
export namespace providerTest {
|
|
3
|
+
function title(providedTitle: string, provider: any): string;
|
|
4
|
+
}
|
|
5
|
+
export function providerParseNameTest(t: any, provider: any, fixtures: any): Promise<void>;
|
|
6
|
+
export namespace providerParseNameTest {
|
|
7
|
+
function title(providedTitle: string, provider: any): string;
|
|
8
|
+
}
|
|
9
|
+
export function providerOptionsFromEnvironmentTest(t: any, factory: any, env: any, expected: any, areOptionsSufficcient?: boolean): Promise<void>;
|
|
10
|
+
export namespace providerOptionsFromEnvironmentTest {
|
|
11
|
+
function title(providedTitle: string, factory: any, env: any, expected: any): string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
export const githubRepositories: {
|
|
2
|
+
"https://github.com/arlac77/sync-test-repository.git#mybranch": {
|
|
3
|
+
base: string;
|
|
4
|
+
group: string;
|
|
5
|
+
repository: string;
|
|
6
|
+
branch: string;
|
|
7
|
+
};
|
|
8
|
+
"https://user:password@github.com/arlac77/sync-test-repository.git#mybranch": {
|
|
9
|
+
base: string;
|
|
10
|
+
group: string;
|
|
11
|
+
repository: string;
|
|
12
|
+
branch: string;
|
|
13
|
+
};
|
|
14
|
+
"https://user@github.com/arlac77/sync-test-repository.git#mybranch": {
|
|
15
|
+
base: string;
|
|
16
|
+
group: string;
|
|
17
|
+
repository: string;
|
|
18
|
+
branch: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export const bitbucketRepositories: {
|
|
22
|
+
"git@bitbucket.org:arlac77/sync-test-repository.git#mybranch": {
|
|
23
|
+
base: string;
|
|
24
|
+
group: string;
|
|
25
|
+
repository: string;
|
|
26
|
+
branch: string;
|
|
27
|
+
};
|
|
28
|
+
"git@bitbucket.org/arlac77/sync-test-repository.git": {
|
|
29
|
+
base: string;
|
|
30
|
+
group: string;
|
|
31
|
+
repository: string;
|
|
32
|
+
};
|
|
33
|
+
"https://arlac77@bitbucket.org/arlac77/sync-test-repository.git": {
|
|
34
|
+
base: string;
|
|
35
|
+
group: string;
|
|
36
|
+
repository: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export const otherRepositories: {
|
|
40
|
+
"http://otherdomain.com/arlac77/sync-test-repository.git#mybranch": {
|
|
41
|
+
base: string;
|
|
42
|
+
group: string;
|
|
43
|
+
repository: string;
|
|
44
|
+
branch: string;
|
|
45
|
+
};
|
|
46
|
+
"git+http://otherdomain.com/arlac77/sync-test-repository.git#mybranch": {
|
|
47
|
+
base: string;
|
|
48
|
+
group: string;
|
|
49
|
+
repository: string;
|
|
50
|
+
branch: string;
|
|
51
|
+
};
|
|
52
|
+
"git+http://arlac77@otherdomain.com/prefix/arlac77/sync-test-repository.git": {
|
|
53
|
+
base: string;
|
|
54
|
+
group: string;
|
|
55
|
+
repository: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export const fragmentRepositories: {
|
|
59
|
+
"": {};
|
|
60
|
+
"abc/def/g": {
|
|
61
|
+
group: string;
|
|
62
|
+
repository: string;
|
|
63
|
+
};
|
|
64
|
+
"xxx/abc/def.git#mybranch": {
|
|
65
|
+
group: string;
|
|
66
|
+
repository: string;
|
|
67
|
+
branch: string;
|
|
68
|
+
};
|
|
69
|
+
abc: {
|
|
70
|
+
repository: string;
|
|
71
|
+
};
|
|
72
|
+
" abc/def": {
|
|
73
|
+
group: string;
|
|
74
|
+
repository: string;
|
|
75
|
+
};
|
|
76
|
+
"abc/def#mybranch ": {
|
|
77
|
+
group: string;
|
|
78
|
+
repository: string;
|
|
79
|
+
branch: string;
|
|
80
|
+
};
|
|
81
|
+
"abc/def.git": {
|
|
82
|
+
group: string;
|
|
83
|
+
repository: string;
|
|
84
|
+
};
|
|
85
|
+
"abc/def.git#mybranch": {
|
|
86
|
+
group: string;
|
|
87
|
+
repository: string;
|
|
88
|
+
branch: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
export const repositories: {
|
|
92
|
+
"http://otherdomain.com/arlac77/sync-test-repository.git#mybranch": {
|
|
93
|
+
base: string;
|
|
94
|
+
group: string;
|
|
95
|
+
repository: string;
|
|
96
|
+
branch: string;
|
|
97
|
+
};
|
|
98
|
+
"git+http://otherdomain.com/arlac77/sync-test-repository.git#mybranch": {
|
|
99
|
+
base: string;
|
|
100
|
+
group: string;
|
|
101
|
+
repository: string;
|
|
102
|
+
branch: string;
|
|
103
|
+
};
|
|
104
|
+
"git+http://arlac77@otherdomain.com/prefix/arlac77/sync-test-repository.git": {
|
|
105
|
+
base: string;
|
|
106
|
+
group: string;
|
|
107
|
+
repository: string;
|
|
108
|
+
};
|
|
109
|
+
"git@bitbucket.org:arlac77/sync-test-repository.git#mybranch": {
|
|
110
|
+
base: string;
|
|
111
|
+
group: string;
|
|
112
|
+
repository: string;
|
|
113
|
+
branch: string;
|
|
114
|
+
};
|
|
115
|
+
"git@bitbucket.org/arlac77/sync-test-repository.git": {
|
|
116
|
+
base: string;
|
|
117
|
+
group: string;
|
|
118
|
+
repository: string;
|
|
119
|
+
};
|
|
120
|
+
"https://arlac77@bitbucket.org/arlac77/sync-test-repository.git": {
|
|
121
|
+
base: string;
|
|
122
|
+
group: string;
|
|
123
|
+
repository: string;
|
|
124
|
+
};
|
|
125
|
+
"https://github.com/arlac77/sync-test-repository.git#mybranch": {
|
|
126
|
+
base: string;
|
|
127
|
+
group: string;
|
|
128
|
+
repository: string;
|
|
129
|
+
branch: string;
|
|
130
|
+
};
|
|
131
|
+
"https://user:password@github.com/arlac77/sync-test-repository.git#mybranch": {
|
|
132
|
+
base: string;
|
|
133
|
+
group: string;
|
|
134
|
+
repository: string;
|
|
135
|
+
branch: string;
|
|
136
|
+
};
|
|
137
|
+
"https://user@github.com/arlac77/sync-test-repository.git#mybranch": {
|
|
138
|
+
base: string;
|
|
139
|
+
group: string;
|
|
140
|
+
repository: string;
|
|
141
|
+
branch: string;
|
|
142
|
+
};
|
|
143
|
+
"": {};
|
|
144
|
+
"abc/def/g": {
|
|
145
|
+
group: string;
|
|
146
|
+
repository: string;
|
|
147
|
+
};
|
|
148
|
+
"xxx/abc/def.git#mybranch": {
|
|
149
|
+
group: string;
|
|
150
|
+
repository: string;
|
|
151
|
+
branch: string;
|
|
152
|
+
};
|
|
153
|
+
abc: {
|
|
154
|
+
repository: string;
|
|
155
|
+
};
|
|
156
|
+
" abc/def": {
|
|
157
|
+
group: string;
|
|
158
|
+
repository: string;
|
|
159
|
+
};
|
|
160
|
+
"abc/def#mybranch ": {
|
|
161
|
+
group: string;
|
|
162
|
+
repository: string;
|
|
163
|
+
branch: string;
|
|
164
|
+
};
|
|
165
|
+
"abc/def.git": {
|
|
166
|
+
group: string;
|
|
167
|
+
repository: string;
|
|
168
|
+
};
|
|
169
|
+
"abc/def.git#mybranch": {
|
|
170
|
+
group: string;
|
|
171
|
+
repository: string;
|
|
172
|
+
branch: string;
|
|
173
|
+
};
|
|
174
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function ownerTypeLookupTest(t: any, type: any, owner: any, name: any, expected: any): Promise<void>;
|
|
2
|
+
export namespace ownerTypeLookupTest {
|
|
3
|
+
function title(providedTitle: string, type: any, owner: any, name: any, expected: any): string;
|
|
4
|
+
}
|
|
5
|
+
export function ownerTypeListTest(t: any, type: any, owner: any, pattern: any, expected: any): Promise<void>;
|
|
6
|
+
export namespace ownerTypeListTest {
|
|
7
|
+
function title(providedTitle: string, type: any, owner: any, pattern: any, expected: any): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export function repositoryEqualityTest(t: any, p1: any, rn1: any, rn2: any): Promise<void>;
|
|
2
|
+
export namespace repositoryEqualityTest {
|
|
3
|
+
function title(providedTitle: string, provider: any): string;
|
|
4
|
+
}
|
|
5
|
+
export function repositoryLivecycleTest(t: any, provider: any, repoName: string, groupName: any, options: any, assert?: (t: any, repository: any) => Promise<void>): Promise<void>;
|
package/types/util.d.mts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* find a new branch name for a given pattern
|
|
3
|
+
* '*' will be replaced by a number
|
|
4
|
+
* 'something/*' will get to something/1 something/2 ...
|
|
5
|
+
* @param {Repository} repository
|
|
6
|
+
* @param {string} pattern
|
|
7
|
+
*/
|
|
8
|
+
export function generateBranchName(repository: Repository, pattern: string): Promise<string>;
|
|
9
|
+
import { Repository } from "repository-provider";
|