semantic-release-vsce 5.7.4 → 6.0.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/README.md +47 -10
- 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 +27 -25
- package/.eslintrc +0 -14
- package/.github/FUNDING.yml +0 -1
- package/.github/dependabot.yml +0 -14
- package/.github/workflows/ci.yaml +0 -44
- package/.github/workflows/dependabot-auto-merge.yaml +0 -22
- package/.github/workflows/validate-pr-title.yaml +0 -16
- package/.husky/pre-commit +0 -4
- package/.prettierrc +0 -3
- package/release.config.js +0 -66
- package/test/index.test.js +0 -261
- package/test/prepare.test.js +0 -189
- package/test/publish.test.js +0 -253
- package/test/verify-ovsx-auth.test.js +0 -60
- package/test/verify-pkg.test.js +0 -119
- package/test/verify-target.test.js +0 -65
- package/test/verify-vsce-auth.test.js +0 -74
- package/test/verify.test.js +0 -171
package/test/verify.test.js
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
const SemanticReleaseError = require('@semantic-release/error');
|
|
2
|
-
const test = require('ava');
|
|
3
|
-
const sinon = require('sinon');
|
|
4
|
-
const proxyquire = require('proxyquire');
|
|
5
|
-
|
|
6
|
-
const logger = {
|
|
7
|
-
log: sinon.fake(),
|
|
8
|
-
};
|
|
9
|
-
const cwd = process.cwd();
|
|
10
|
-
|
|
11
|
-
test('resolves', async (t) => {
|
|
12
|
-
const verify = proxyquire('../lib/verify', {
|
|
13
|
-
'./verify-pkg': sinon.stub().resolves(),
|
|
14
|
-
'./verify-target': sinon.stub().resolves(),
|
|
15
|
-
'./verify-vsce-auth': sinon.stub().resolves(),
|
|
16
|
-
'./verify-ovsx-auth': sinon.stub().resolves(),
|
|
17
|
-
'./utils': {
|
|
18
|
-
isVscePublishEnabled: sinon.stub().returns(true),
|
|
19
|
-
isOvsxPublishEnabled: sinon.stub().returns(true),
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
await t.notThrowsAsync(() => verify({}, { logger, cwd }));
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
test('rejects with verify-pkg', async (t) => {
|
|
27
|
-
const verify = proxyquire('../lib/verify', {
|
|
28
|
-
'./verify-pkg': sinon.stub().rejects(),
|
|
29
|
-
'./verify-target': sinon.stub().resolves(),
|
|
30
|
-
'./verify-vsce-auth': sinon.stub().resolves(),
|
|
31
|
-
'./verify-ovsx-auth': sinon.stub().resolves(),
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
await t.throwsAsync(() => verify({}, { logger, cwd }));
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
test('rejects with verify-target', async (t) => {
|
|
38
|
-
const verify = proxyquire('../lib/verify', {
|
|
39
|
-
'./verify-pkg': sinon.stub().resolves(),
|
|
40
|
-
'./verify-target': sinon.stub().rejects(),
|
|
41
|
-
'./verify-vsce-auth': sinon.stub().resolves(),
|
|
42
|
-
'./verify-ovsx-auth': sinon.stub().resolves(),
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
await t.throwsAsync(() => verify({}, { logger, cwd }));
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
test('rejects with verify-auth', async (t) => {
|
|
49
|
-
const verify = proxyquire('../lib/verify', {
|
|
50
|
-
'./verify-pkg': sinon.stub().resolves(),
|
|
51
|
-
'./verify-target': sinon.stub().resolves(),
|
|
52
|
-
'./verify-vsce-auth': sinon.stub().rejects(),
|
|
53
|
-
'./verify-ovsx-auth': sinon.stub().resolves(),
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
await t.throwsAsync(() => verify({}, { logger, cwd }));
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
test('rejects with verify-ovsx-auth', async (t) => {
|
|
60
|
-
const verify = proxyquire('../lib/verify', {
|
|
61
|
-
'./verify-pkg': sinon.stub().resolves(),
|
|
62
|
-
'./verify-target': sinon.stub().resolves(),
|
|
63
|
-
'./verify-vsce-auth': sinon.stub().resolves(),
|
|
64
|
-
'./verify-ovsx-auth': sinon.stub().rejects(),
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
await t.throwsAsync(() => verify({}, { logger, cwd }));
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
test('it does not verify the auth tokens if publishing is disabled', async (t) => {
|
|
71
|
-
const stubs = {
|
|
72
|
-
verifyPkgStub: sinon.stub().resolves(),
|
|
73
|
-
verifyTargetStub: sinon.stub().resolves(),
|
|
74
|
-
verifyVsceAuthStub: sinon.stub().resolves(),
|
|
75
|
-
verifyOvsxAuthStub: sinon.stub().resolves(),
|
|
76
|
-
};
|
|
77
|
-
const verify = proxyquire('../lib/verify', {
|
|
78
|
-
'./verify-pkg': stubs.verifyPkgStub,
|
|
79
|
-
'./verify-target': stubs.verifyTargetStub,
|
|
80
|
-
'./verify-vsce-auth': stubs.verifyVsceAuthStub,
|
|
81
|
-
'./verify-ovsx-auth': stubs.verifyOvsxAuthStub,
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
await verify({ publish: false }, { logger, cwd });
|
|
85
|
-
|
|
86
|
-
t.true(stubs.verifyVsceAuthStub.notCalled);
|
|
87
|
-
t.true(stubs.verifyOvsxAuthStub.notCalled);
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
test('errors when neither vsce nor ovsx personal access token is configured', async (t) => {
|
|
91
|
-
const stubs = {
|
|
92
|
-
verifyPkgStub: sinon.stub().resolves(),
|
|
93
|
-
verifyTargetStub: sinon.stub().resolves(),
|
|
94
|
-
verifyVsceAuthStub: sinon.stub().resolves(),
|
|
95
|
-
verifyOvsxAuthStub: sinon.stub().resolves(),
|
|
96
|
-
utilsStub: {
|
|
97
|
-
isVscePublishEnabled: sinon.stub().returns(false),
|
|
98
|
-
isOvsxPublishEnabled: sinon.stub().returns(false),
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
const verify = proxyquire('../lib/verify', {
|
|
102
|
-
'./verify-pkg': stubs.verifyPkgStub,
|
|
103
|
-
'./verify-target': stubs.verifyTargetStub,
|
|
104
|
-
'./verify-vsce-auth': stubs.verifyVsceAuthStub,
|
|
105
|
-
'./verify-ovsx-auth': stubs.verifyOvsxAuthStub,
|
|
106
|
-
'./utils': stubs.utilsStub,
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
await t.throwsAsync(() => verify({}, { logger, cwd }), {
|
|
110
|
-
instanceOf: SemanticReleaseError,
|
|
111
|
-
code: 'ENOPAT',
|
|
112
|
-
});
|
|
113
|
-
t.true(stubs.verifyVsceAuthStub.notCalled);
|
|
114
|
-
t.true(stubs.verifyOvsxAuthStub.notCalled);
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
test('verify vsce only', async (t) => {
|
|
118
|
-
const stubs = {
|
|
119
|
-
verifyPkgStub: sinon.stub().resolves(),
|
|
120
|
-
verifyTargetStub: sinon.stub().resolves(),
|
|
121
|
-
verifyVsceAuthStub: sinon.stub().resolves(),
|
|
122
|
-
verifyOvsxAuthStub: sinon.stub().resolves(),
|
|
123
|
-
utilsStub: {
|
|
124
|
-
isVscePublishEnabled: sinon.stub().returns(true),
|
|
125
|
-
isOvsxPublishEnabled: sinon.stub().returns(false),
|
|
126
|
-
},
|
|
127
|
-
logger: {
|
|
128
|
-
log: sinon.fake(),
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
const verify = proxyquire('../lib/verify', {
|
|
132
|
-
'./verify-pkg': stubs.verifyPkgStub,
|
|
133
|
-
'./verify-target': stubs.verifyTargetStub,
|
|
134
|
-
'./verify-vsce-auth': stubs.verifyVsceAuthStub,
|
|
135
|
-
'./verify-ovsx-auth': stubs.verifyOvsxAuthStub,
|
|
136
|
-
'./utils': stubs.utilsStub,
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
await verify({}, { logger: stubs.logger, cwd });
|
|
140
|
-
t.true(stubs.verifyVsceAuthStub.calledOnce);
|
|
141
|
-
t.true(stubs.verifyOvsxAuthStub.notCalled);
|
|
142
|
-
t.true(stubs.logger.log.calledOnce);
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
test('verify ovsx only', async (t) => {
|
|
146
|
-
const stubs = {
|
|
147
|
-
verifyPkgStub: sinon.stub().resolves(),
|
|
148
|
-
verifyTargetStub: sinon.stub().resolves(),
|
|
149
|
-
verifyVsceAuthStub: sinon.stub().resolves(),
|
|
150
|
-
verifyOvsxAuthStub: sinon.stub().resolves(),
|
|
151
|
-
utilsStub: {
|
|
152
|
-
isVscePublishEnabled: sinon.stub().returns(false),
|
|
153
|
-
isOvsxPublishEnabled: sinon.stub().returns(true),
|
|
154
|
-
},
|
|
155
|
-
logger: {
|
|
156
|
-
log: sinon.fake(),
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
const verify = proxyquire('../lib/verify', {
|
|
160
|
-
'./verify-pkg': stubs.verifyPkgStub,
|
|
161
|
-
'./verify-target': stubs.verifyTargetStub,
|
|
162
|
-
'./verify-vsce-auth': stubs.verifyVsceAuthStub,
|
|
163
|
-
'./verify-ovsx-auth': stubs.verifyOvsxAuthStub,
|
|
164
|
-
'./utils': stubs.utilsStub,
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
await verify({}, { logger: stubs.logger, cwd });
|
|
168
|
-
t.true(stubs.verifyVsceAuthStub.notCalled);
|
|
169
|
-
t.true(stubs.verifyOvsxAuthStub.calledOnce);
|
|
170
|
-
t.true(stubs.logger.log.calledOnce);
|
|
171
|
-
});
|