semantic-release-vsce 5.7.3 → 6.0.0
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/.github/workflows/ci.yaml +12 -3
- package/README.md +47 -10
- package/eslint.config.js +7 -0
- package/index.js +13 -21
- package/lib/prepare.js +8 -7
- package/lib/publish.js +14 -8
- package/lib/utils.js +17 -13
- package/lib/verify-ovsx-auth.js +5 -4
- package/lib/verify-pkg.js +7 -8
- package/lib/verify-target.js +6 -5
- package/lib/verify-vsce-auth.js +25 -10
- package/lib/verify.js +10 -10
- package/package.json +22 -23
- package/release.config.js +9 -1
- package/test/index.test.js +115 -56
- package/test/prepare.test.js +50 -31
- package/test/publish.test.js +155 -41
- package/test/verify-ovsx-auth.test.js +21 -17
- package/test/verify-pkg.test.js +32 -41
- package/test/verify-target.test.js +20 -17
- package/test/verify-vsce-auth.test.js +123 -29
- package/test/verify.test.js +152 -80
- package/.eslintrc +0 -14
|
@@ -1,70 +1,144 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import avaTest from 'ava';
|
|
2
|
+
import { fake, stub } from 'sinon';
|
|
3
|
+
import esmock from 'esmock';
|
|
4
|
+
import SemanticReleaseError from '@semantic-release/error';
|
|
5
|
+
|
|
6
|
+
// Run tests serially to avoid env pollution
|
|
7
|
+
const test = avaTest.serial;
|
|
5
8
|
|
|
6
9
|
const logger = {
|
|
7
|
-
log:
|
|
10
|
+
log: fake(),
|
|
8
11
|
};
|
|
9
12
|
const cwd = process.cwd();
|
|
10
13
|
|
|
11
14
|
test('VSCE_PAT is set', async (t) => {
|
|
12
|
-
|
|
15
|
+
stub(process, 'env').value({
|
|
13
16
|
VSCE_PAT: 'abc123',
|
|
14
17
|
});
|
|
15
18
|
|
|
16
|
-
const verifyVsceAuth =
|
|
17
|
-
execa:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const { verifyVsceAuth } = await esmock('../lib/verify-vsce-auth.js', {
|
|
20
|
+
execa: {
|
|
21
|
+
execa: stub()
|
|
22
|
+
.withArgs('vsce', ['verify-pat'], { preferLocal: true, cwd })
|
|
23
|
+
.resolves(),
|
|
24
|
+
},
|
|
21
25
|
});
|
|
22
26
|
|
|
23
27
|
await t.notThrowsAsync(() => verifyVsceAuth(logger));
|
|
24
28
|
});
|
|
25
29
|
|
|
30
|
+
test('VSCE_AZURE_CREDENTIAL is set to true', async (t) => {
|
|
31
|
+
stub(process, 'env').value({
|
|
32
|
+
VSCE_AZURE_CREDENTIAL: 'true',
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const { verifyVsceAuth } = await esmock('../lib/verify-vsce-auth.js', {
|
|
36
|
+
execa: {
|
|
37
|
+
execa: stub()
|
|
38
|
+
.withArgs('vsce', ['verify-pat', '--azure-credential'], {
|
|
39
|
+
preferLocal: true,
|
|
40
|
+
cwd,
|
|
41
|
+
})
|
|
42
|
+
.resolves(),
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
await t.notThrowsAsync(() => verifyVsceAuth(logger));
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('VSCE_AZURE_CREDENTIAL is set to 1', async (t) => {
|
|
50
|
+
stub(process, 'env').value({
|
|
51
|
+
VSCE_AZURE_CREDENTIAL: '1',
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const { verifyVsceAuth } = await esmock('../lib/verify-vsce-auth.js', {
|
|
55
|
+
execa: {
|
|
56
|
+
execa: stub()
|
|
57
|
+
.withArgs('vsce', ['verify-pat', '--azure-credential'], {
|
|
58
|
+
preferLocal: true,
|
|
59
|
+
cwd,
|
|
60
|
+
})
|
|
61
|
+
.resolves(),
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
await t.notThrowsAsync(() => verifyVsceAuth(logger));
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test('VSCE_AZURE_CREDENTIAL is set to false', async (t) => {
|
|
69
|
+
stub(process, 'env').value({
|
|
70
|
+
VSCE_AZURE_CREDENTIAL: 'false',
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const { verifyVsceAuth } = await import('../lib/verify-vsce-auth.js');
|
|
74
|
+
|
|
75
|
+
await t.throwsAsync(() => verifyVsceAuth(logger), {
|
|
76
|
+
instanceOf: SemanticReleaseError,
|
|
77
|
+
code: 'EVSCEAUTHNOTPROVIDED',
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
26
81
|
test('VSCE_PAT is valid', async (t) => {
|
|
27
|
-
|
|
82
|
+
stub(process, 'env').value({
|
|
28
83
|
VSCE_PAT: 'abc123',
|
|
29
84
|
});
|
|
30
85
|
|
|
31
|
-
const verifyVsceAuth =
|
|
32
|
-
execa:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
86
|
+
const { verifyVsceAuth } = await esmock('../lib/verify-vsce-auth.js', {
|
|
87
|
+
execa: {
|
|
88
|
+
execa: stub()
|
|
89
|
+
.withArgs('vsce', ['verify-pat'], { preferLocal: true, cwd })
|
|
90
|
+
.resolves(),
|
|
91
|
+
},
|
|
36
92
|
});
|
|
37
93
|
|
|
38
94
|
await t.notThrowsAsync(() => verifyVsceAuth(logger));
|
|
39
95
|
});
|
|
40
96
|
|
|
41
|
-
test('VSCE_PAT is
|
|
97
|
+
test('VSCE_PAT is valid and VSCE_AZURE_CREDENTIAL=false', async (t) => {
|
|
98
|
+
stub(process, 'env').value({
|
|
99
|
+
VSCE_PAT: 'abc123',
|
|
100
|
+
VSCE_AZURE_CREDENTIAL: 'false',
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const { verifyVsceAuth } = await esmock('../lib/verify-vsce-auth.js', {
|
|
104
|
+
execa: {
|
|
105
|
+
execa: stub()
|
|
106
|
+
.withArgs('vsce', ['verify-pat'], { preferLocal: true, cwd })
|
|
107
|
+
.resolves(),
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
await t.notThrowsAsync(() => verifyVsceAuth(logger));
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
test('Neither VSCE_PAT or VSCE_AZURE_CREDENTIAL are set', async (t) => {
|
|
42
115
|
const logger = {
|
|
43
|
-
log:
|
|
116
|
+
log: fake(),
|
|
44
117
|
};
|
|
45
118
|
|
|
46
|
-
|
|
119
|
+
stub(process, 'env').value({
|
|
47
120
|
VSCE_PAT: '',
|
|
48
121
|
});
|
|
49
122
|
|
|
50
|
-
const
|
|
123
|
+
const { verifyVsceAuth } = await import('../lib/verify-vsce-auth.js');
|
|
51
124
|
|
|
52
|
-
await t.throwsAsync(() =>
|
|
125
|
+
await t.throwsAsync(() => verifyVsceAuth(logger), {
|
|
53
126
|
instanceOf: SemanticReleaseError,
|
|
54
|
-
code: '
|
|
127
|
+
code: 'EVSCEAUTHNOTPROVIDED',
|
|
55
128
|
});
|
|
56
129
|
});
|
|
57
130
|
|
|
58
131
|
test('VSCE_PAT is invalid but not empty', async (t) => {
|
|
59
|
-
|
|
132
|
+
stub(process, 'env').value({
|
|
60
133
|
VSCE_PAT: 'abc123',
|
|
61
134
|
});
|
|
62
135
|
|
|
63
|
-
const verifyVsceAuth =
|
|
64
|
-
execa:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
136
|
+
const { verifyVsceAuth } = await esmock('../lib/verify-vsce-auth.js', {
|
|
137
|
+
execa: {
|
|
138
|
+
execa: stub()
|
|
139
|
+
.withArgs('vsce', ['verify-pat'], { preferLocal: true, cwd })
|
|
140
|
+
.rejects(),
|
|
141
|
+
},
|
|
68
142
|
});
|
|
69
143
|
|
|
70
144
|
await t.throwsAsync(() => verifyVsceAuth(logger), {
|
|
@@ -72,3 +146,23 @@ test('VSCE_PAT is invalid but not empty', async (t) => {
|
|
|
72
146
|
code: 'EINVALIDVSCEPAT',
|
|
73
147
|
});
|
|
74
148
|
});
|
|
149
|
+
|
|
150
|
+
test('Both VSCE_PAT and VSCE_AZURE_CREDENTIAL are set', async (t) => {
|
|
151
|
+
stub(process, 'env').value({
|
|
152
|
+
VSCE_PAT: 'abc123',
|
|
153
|
+
VSCE_AZURE_CREDENTIAL: 'true',
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
const { verifyVsceAuth } = await esmock('../lib/verify-vsce-auth.js', {
|
|
157
|
+
execa: {
|
|
158
|
+
execa: stub()
|
|
159
|
+
.withArgs('vsce', ['verify-pat'], { preferLocal: true, cwd })
|
|
160
|
+
.rejects(),
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
await t.throwsAsync(() => verifyVsceAuth(logger), {
|
|
165
|
+
instanceOf: SemanticReleaseError,
|
|
166
|
+
code: 'EVSCEDUPLICATEAUTHPROVIDED',
|
|
167
|
+
});
|
|
168
|
+
});
|
package/test/verify.test.js
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import SemanticReleaseError from '@semantic-release/error';
|
|
2
|
+
import test from 'ava';
|
|
3
|
+
import { fake, stub } from 'sinon';
|
|
4
|
+
import esmock from 'esmock';
|
|
5
5
|
|
|
6
6
|
const logger = {
|
|
7
|
-
log:
|
|
7
|
+
log: fake(),
|
|
8
8
|
};
|
|
9
9
|
const cwd = process.cwd();
|
|
10
10
|
|
|
11
11
|
test('resolves', async (t) => {
|
|
12
|
-
const verify =
|
|
13
|
-
'
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
'
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
const { verify } = await esmock('../lib/verify.js', {
|
|
13
|
+
'../lib/verify-pkg.js': {
|
|
14
|
+
verifyPkg: stub().resolves(),
|
|
15
|
+
},
|
|
16
|
+
'../lib/verify-target.js': {
|
|
17
|
+
verifyTarget: stub().resolves(),
|
|
18
|
+
},
|
|
19
|
+
'../lib/verify-vsce-auth.js': {
|
|
20
|
+
verifyVsceAuth: stub().resolves(),
|
|
21
|
+
},
|
|
22
|
+
'../lib/verify-ovsx-auth.js': {
|
|
23
|
+
verifyOvsxAuth: stub().resolves(),
|
|
24
|
+
},
|
|
25
|
+
'../lib/utils.js': {
|
|
26
|
+
isVscePublishEnabled: stub().returns(true),
|
|
27
|
+
isOvsxPublishEnabled: stub().returns(true),
|
|
20
28
|
},
|
|
21
29
|
});
|
|
22
30
|
|
|
@@ -24,44 +32,76 @@ test('resolves', async (t) => {
|
|
|
24
32
|
});
|
|
25
33
|
|
|
26
34
|
test('rejects with verify-pkg', async (t) => {
|
|
27
|
-
const verify =
|
|
28
|
-
'
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
'
|
|
35
|
+
const { verify } = await esmock('../lib/verify.js', {
|
|
36
|
+
'../lib/verify-pkg.js': {
|
|
37
|
+
verifyPkg: stub().rejects(),
|
|
38
|
+
},
|
|
39
|
+
'../lib/verify-target.js': {
|
|
40
|
+
verifyTarget: stub().resolves(),
|
|
41
|
+
},
|
|
42
|
+
'../lib/verify-vsce-auth.js': {
|
|
43
|
+
verifyVsceAuth: stub().resolves(),
|
|
44
|
+
},
|
|
45
|
+
'../lib/verify-ovsx-auth.js': {
|
|
46
|
+
verifyOvsxAuth: stub().resolves(),
|
|
47
|
+
},
|
|
32
48
|
});
|
|
33
49
|
|
|
34
50
|
await t.throwsAsync(() => verify({}, { logger, cwd }));
|
|
35
51
|
});
|
|
36
52
|
|
|
37
53
|
test('rejects with verify-target', async (t) => {
|
|
38
|
-
const verify =
|
|
39
|
-
'
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
'
|
|
54
|
+
const { verify } = await esmock('../lib/verify.js', {
|
|
55
|
+
'../lib/verify-pkg.js': {
|
|
56
|
+
verifyPkg: stub().resolves(),
|
|
57
|
+
},
|
|
58
|
+
'../lib/verify-target.js': {
|
|
59
|
+
verifyTarget: stub().rejects(),
|
|
60
|
+
},
|
|
61
|
+
'../lib/verify-vsce-auth.js': {
|
|
62
|
+
verifyVsceAuth: stub().resolves(),
|
|
63
|
+
},
|
|
64
|
+
'../lib/verify-ovsx-auth.js': {
|
|
65
|
+
verifyOvsxAuth: stub().resolves(),
|
|
66
|
+
},
|
|
43
67
|
});
|
|
44
68
|
|
|
45
69
|
await t.throwsAsync(() => verify({}, { logger, cwd }));
|
|
46
70
|
});
|
|
47
71
|
|
|
48
72
|
test('rejects with verify-auth', async (t) => {
|
|
49
|
-
const verify =
|
|
50
|
-
'
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
'
|
|
73
|
+
const { verify } = await esmock('../lib/verify.js', {
|
|
74
|
+
'../lib/verify-pkg.js': {
|
|
75
|
+
verifyPkg: stub().resolves(),
|
|
76
|
+
},
|
|
77
|
+
'../lib/verify-target.js': {
|
|
78
|
+
verifyTarget: stub().resolves(),
|
|
79
|
+
},
|
|
80
|
+
'../lib/verify-vsce-auth.js': {
|
|
81
|
+
verifyVsceAuth: stub().rejects(),
|
|
82
|
+
},
|
|
83
|
+
'../lib/verify-ovsx-auth.js': {
|
|
84
|
+
verifyOvsxAuth: stub().resolves(),
|
|
85
|
+
},
|
|
54
86
|
});
|
|
55
87
|
|
|
56
88
|
await t.throwsAsync(() => verify({}, { logger, cwd }));
|
|
57
89
|
});
|
|
58
90
|
|
|
59
91
|
test('rejects with verify-ovsx-auth', async (t) => {
|
|
60
|
-
const verify =
|
|
61
|
-
'
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
'
|
|
92
|
+
const { verify } = await esmock('../lib/verify.js', {
|
|
93
|
+
'../lib/verify-pkg.js': {
|
|
94
|
+
verifyPkg: stub().resolves(),
|
|
95
|
+
},
|
|
96
|
+
'../lib/verify-target.js': {
|
|
97
|
+
verifyTarget: stub().resolves(),
|
|
98
|
+
},
|
|
99
|
+
'../lib/verify-vsce-auth.js': {
|
|
100
|
+
verifyVsceAuth: stub().resolves(),
|
|
101
|
+
},
|
|
102
|
+
'../lib/verify-ovsx-auth.js': {
|
|
103
|
+
verifyOvsxAuth: stub().rejects(),
|
|
104
|
+
},
|
|
65
105
|
});
|
|
66
106
|
|
|
67
107
|
await t.throwsAsync(() => verify({}, { logger, cwd }));
|
|
@@ -69,16 +109,24 @@ test('rejects with verify-ovsx-auth', async (t) => {
|
|
|
69
109
|
|
|
70
110
|
test('it does not verify the auth tokens if publishing is disabled', async (t) => {
|
|
71
111
|
const stubs = {
|
|
72
|
-
verifyPkgStub:
|
|
73
|
-
verifyTargetStub:
|
|
74
|
-
verifyVsceAuthStub:
|
|
75
|
-
verifyOvsxAuthStub:
|
|
112
|
+
verifyPkgStub: stub().resolves(),
|
|
113
|
+
verifyTargetStub: stub().resolves(),
|
|
114
|
+
verifyVsceAuthStub: stub().resolves(),
|
|
115
|
+
verifyOvsxAuthStub: stub().resolves(),
|
|
76
116
|
};
|
|
77
|
-
const verify =
|
|
78
|
-
'
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
'
|
|
117
|
+
const { verify } = await esmock('../lib/verify.js', {
|
|
118
|
+
'../lib/verify-pkg.js': {
|
|
119
|
+
verifyPkg: stubs.verifyPkgStub,
|
|
120
|
+
},
|
|
121
|
+
'../lib/verify-target.js': {
|
|
122
|
+
verifyTarget: stubs.verifyTargetStub,
|
|
123
|
+
},
|
|
124
|
+
'../lib/verify-vsce-auth.js': {
|
|
125
|
+
verifyVsceAuth: stubs.verifyVsceAuthStub,
|
|
126
|
+
},
|
|
127
|
+
'../lib/verify-ovsx-auth.js': {
|
|
128
|
+
verifyOvsxAuth: stubs.verifyOvsxAuthStub,
|
|
129
|
+
},
|
|
82
130
|
});
|
|
83
131
|
|
|
84
132
|
await verify({ publish: false }, { logger, cwd });
|
|
@@ -89,21 +137,29 @@ test('it does not verify the auth tokens if publishing is disabled', async (t) =
|
|
|
89
137
|
|
|
90
138
|
test('errors when neither vsce nor ovsx personal access token is configured', async (t) => {
|
|
91
139
|
const stubs = {
|
|
92
|
-
verifyPkgStub:
|
|
93
|
-
verifyTargetStub:
|
|
94
|
-
verifyVsceAuthStub:
|
|
95
|
-
verifyOvsxAuthStub:
|
|
140
|
+
verifyPkgStub: stub().resolves(),
|
|
141
|
+
verifyTargetStub: stub().resolves(),
|
|
142
|
+
verifyVsceAuthStub: stub().resolves(),
|
|
143
|
+
verifyOvsxAuthStub: stub().resolves(),
|
|
96
144
|
utilsStub: {
|
|
97
|
-
isVscePublishEnabled:
|
|
98
|
-
isOvsxPublishEnabled:
|
|
145
|
+
isVscePublishEnabled: stub().returns(false),
|
|
146
|
+
isOvsxPublishEnabled: stub().returns(false),
|
|
99
147
|
},
|
|
100
148
|
};
|
|
101
|
-
const verify =
|
|
102
|
-
'
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
'
|
|
106
|
-
|
|
149
|
+
const { verify } = await esmock('../lib/verify.js', {
|
|
150
|
+
'../lib/verify-pkg.js': {
|
|
151
|
+
verifyPkg: stubs.verifyPkgStub,
|
|
152
|
+
},
|
|
153
|
+
'../lib/verify-target.js': {
|
|
154
|
+
verifyTarget: stubs.verifyTargetStub,
|
|
155
|
+
},
|
|
156
|
+
'../lib/verify-vsce-auth.js': {
|
|
157
|
+
verifyVsceAuth: stubs.verifyVsceAuthStub,
|
|
158
|
+
},
|
|
159
|
+
'../lib/verify-ovsx-auth.js': {
|
|
160
|
+
verifyOvsxAuth: stubs.verifyOvsxAuthStub,
|
|
161
|
+
},
|
|
162
|
+
'../lib/utils.js': stubs.utilsStub,
|
|
107
163
|
});
|
|
108
164
|
|
|
109
165
|
await t.throwsAsync(() => verify({}, { logger, cwd }), {
|
|
@@ -116,24 +172,32 @@ test('errors when neither vsce nor ovsx personal access token is configured', as
|
|
|
116
172
|
|
|
117
173
|
test('verify vsce only', async (t) => {
|
|
118
174
|
const stubs = {
|
|
119
|
-
verifyPkgStub:
|
|
120
|
-
verifyTargetStub:
|
|
121
|
-
verifyVsceAuthStub:
|
|
122
|
-
verifyOvsxAuthStub:
|
|
175
|
+
verifyPkgStub: stub().resolves(),
|
|
176
|
+
verifyTargetStub: stub().resolves(),
|
|
177
|
+
verifyVsceAuthStub: stub().resolves(),
|
|
178
|
+
verifyOvsxAuthStub: stub().resolves(),
|
|
123
179
|
utilsStub: {
|
|
124
|
-
isVscePublishEnabled:
|
|
125
|
-
isOvsxPublishEnabled:
|
|
180
|
+
isVscePublishEnabled: stub().returns(true),
|
|
181
|
+
isOvsxPublishEnabled: stub().returns(false),
|
|
126
182
|
},
|
|
127
183
|
logger: {
|
|
128
|
-
log:
|
|
184
|
+
log: fake(),
|
|
129
185
|
},
|
|
130
186
|
};
|
|
131
|
-
const verify =
|
|
132
|
-
'
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
'
|
|
136
|
-
|
|
187
|
+
const { verify } = await esmock('../lib/verify.js', {
|
|
188
|
+
'../lib/verify-pkg.js': {
|
|
189
|
+
verifyPkg: stubs.verifyPkgStub,
|
|
190
|
+
},
|
|
191
|
+
'../lib/verify-target.js': {
|
|
192
|
+
verifyTarget: stubs.verifyTargetStub,
|
|
193
|
+
},
|
|
194
|
+
'../lib/verify-vsce-auth.js': {
|
|
195
|
+
verifyVsceAuth: stubs.verifyVsceAuthStub,
|
|
196
|
+
},
|
|
197
|
+
'../lib/verify-ovsx-auth.js': {
|
|
198
|
+
verifyOvsxAuth: stubs.verifyOvsxAuthStub,
|
|
199
|
+
},
|
|
200
|
+
'../lib/utils.js': stubs.utilsStub,
|
|
137
201
|
});
|
|
138
202
|
|
|
139
203
|
await verify({}, { logger: stubs.logger, cwd });
|
|
@@ -144,24 +208,32 @@ test('verify vsce only', async (t) => {
|
|
|
144
208
|
|
|
145
209
|
test('verify ovsx only', async (t) => {
|
|
146
210
|
const stubs = {
|
|
147
|
-
verifyPkgStub:
|
|
148
|
-
verifyTargetStub:
|
|
149
|
-
verifyVsceAuthStub:
|
|
150
|
-
verifyOvsxAuthStub:
|
|
211
|
+
verifyPkgStub: stub().resolves(),
|
|
212
|
+
verifyTargetStub: stub().resolves(),
|
|
213
|
+
verifyVsceAuthStub: stub().resolves(),
|
|
214
|
+
verifyOvsxAuthStub: stub().resolves(),
|
|
151
215
|
utilsStub: {
|
|
152
|
-
isVscePublishEnabled:
|
|
153
|
-
isOvsxPublishEnabled:
|
|
216
|
+
isVscePublishEnabled: stub().returns(false),
|
|
217
|
+
isOvsxPublishEnabled: stub().returns(true),
|
|
154
218
|
},
|
|
155
219
|
logger: {
|
|
156
|
-
log:
|
|
220
|
+
log: fake(),
|
|
157
221
|
},
|
|
158
222
|
};
|
|
159
|
-
const verify =
|
|
160
|
-
'
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
'
|
|
164
|
-
|
|
223
|
+
const { verify } = await esmock('../lib/verify.js', {
|
|
224
|
+
'../lib/verify-pkg.js': {
|
|
225
|
+
verifyPkg: stubs.verifyPkgStub,
|
|
226
|
+
},
|
|
227
|
+
'../lib/verify-target.js': {
|
|
228
|
+
verifyTarget: stubs.verifyTargetStub,
|
|
229
|
+
},
|
|
230
|
+
'../lib/verify-vsce-auth.js': {
|
|
231
|
+
verifyVsceAuth: stubs.verifyVsceAuthStub,
|
|
232
|
+
},
|
|
233
|
+
'../lib/verify-ovsx-auth.js': {
|
|
234
|
+
verifyOvsxAuth: stubs.verifyOvsxAuthStub,
|
|
235
|
+
},
|
|
236
|
+
'../lib/utils.js': stubs.utilsStub,
|
|
165
237
|
});
|
|
166
238
|
|
|
167
239
|
await verify({}, { logger: stubs.logger, cwd });
|
package/.eslintrc
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"es6": true,
|
|
4
|
-
"node": true
|
|
5
|
-
},
|
|
6
|
-
"extends": ["standard", "prettier"],
|
|
7
|
-
"rules": {
|
|
8
|
-
"no-console": "off",
|
|
9
|
-
"indent": ["error", 2],
|
|
10
|
-
"linebreak-style": ["error", "unix"],
|
|
11
|
-
"quotes": ["error", "single"],
|
|
12
|
-
"semi": ["error", "always"]
|
|
13
|
-
}
|
|
14
|
-
}
|