@@ -9,8 +9,8 @@ import type {
9
9
import type { createAndPublishDownloadCenterConfig as createAndPublishDownloadCenterConfigFn } from './download-center' ;
10
10
import { GithubRepo } from '@mongodb-js/devtools-github-repo' ;
11
11
import type { publishToHomebrew as publishToHomebrewType } from './homebrew' ;
12
- import type { publishNpmPackages as publishNpmPackagesType } from './npm-packages' ;
13
- import { runPublish } from './run- publish' ;
12
+ import type { publishToNpm as publishToNpmType } from './npm-packages' ;
13
+ import { publishMongosh } from './publish-mongosh ' ;
14
14
import { dummyConfig } from '../test/helpers' ;
15
15
16
16
chai . use ( require ( 'sinon-chai' ) ) ;
@@ -26,10 +26,10 @@ function createStubBarque(overrides?: any): Barque {
26
26
return sinon . createStubInstance ( Barque , overrides ) as unknown as Barque ;
27
27
}
28
28
29
- describe ( 'publish ' , function ( ) {
29
+ describe ( 'publishMongosh ' , function ( ) {
30
30
let config : Config ;
31
31
let createAndPublishDownloadCenterConfig : typeof createAndPublishDownloadCenterConfigFn ;
32
- let publishNpmPackages : typeof publishNpmPackagesType ;
32
+ let publishToNpm : typeof publishToNpmType ;
33
33
let writeBuildInfo : typeof writeBuildInfoType ;
34
34
let publishToHomebrew : typeof publishToHomebrewType ;
35
35
let shouldDoPublicRelease : typeof shouldDoPublicReleaseFn ;
@@ -42,7 +42,7 @@ describe('publish', function () {
42
42
config = { ...dummyConfig } ;
43
43
44
44
createAndPublishDownloadCenterConfig = sinon . spy ( ) ;
45
- publishNpmPackages = sinon . spy ( ) ;
45
+ publishToNpm = sinon . spy ( ) ;
46
46
writeBuildInfo = sinon . spy ( ) ;
47
47
publishToHomebrew = sinon . spy ( ) ;
48
48
shouldDoPublicRelease = sinon . spy ( ) ;
@@ -78,14 +78,14 @@ describe('publish', function () {
78
78
getMostRecentDraftTagForRelease : sinon . stub ( ) . resolves ( undefined ) ,
79
79
} ) ;
80
80
try {
81
- await runPublish (
81
+ await publishMongosh (
82
82
config ,
83
83
githubRepo ,
84
84
mongoHomebrewCoreForkRepo ,
85
85
homebrewCoreRepo ,
86
86
barque ,
87
87
createAndPublishDownloadCenterConfig ,
88
- publishNpmPackages ,
88
+ publishToNpm ,
89
89
writeBuildInfo ,
90
90
publishToHomebrew ,
91
91
shouldDoPublicRelease
@@ -103,14 +103,14 @@ describe('publish', function () {
103
103
. resolves ( { name : 'v0.7.0-draft.42' , sha : 'wrong' } ) ,
104
104
} ) ;
105
105
try {
106
- await runPublish (
106
+ await publishMongosh (
107
107
config ,
108
108
githubRepo ,
109
109
mongoHomebrewCoreForkRepo ,
110
110
homebrewCoreRepo ,
111
111
barque ,
112
112
createAndPublishDownloadCenterConfig ,
113
- publishNpmPackages ,
113
+ publishToNpm ,
114
114
writeBuildInfo ,
115
115
publishToHomebrew ,
116
116
shouldDoPublicRelease
@@ -123,14 +123,14 @@ describe('publish', function () {
123
123
} ) ;
124
124
125
125
it ( 'publishes artifacts to barque' , async function ( ) {
126
- await runPublish (
126
+ await publishMongosh (
127
127
config ,
128
128
githubRepo ,
129
129
mongoHomebrewCoreForkRepo ,
130
130
homebrewCoreRepo ,
131
131
barque ,
132
132
createAndPublishDownloadCenterConfig ,
133
- publishNpmPackages ,
133
+ publishToNpm ,
134
134
writeBuildInfo ,
135
135
publishToHomebrew ,
136
136
shouldDoPublicRelease
@@ -153,14 +153,14 @@ describe('publish', function () {
153
153
} ) ;
154
154
155
155
it ( 'updates the download center config' , async function ( ) {
156
- await runPublish (
156
+ await publishMongosh (
157
157
config ,
158
158
githubRepo ,
159
159
mongoHomebrewCoreForkRepo ,
160
160
homebrewCoreRepo ,
161
161
barque ,
162
162
createAndPublishDownloadCenterConfig ,
163
- publishNpmPackages ,
163
+ publishToNpm ,
164
164
writeBuildInfo ,
165
165
publishToHomebrew ,
166
166
shouldDoPublicRelease
@@ -175,14 +175,14 @@ describe('publish', function () {
175
175
} ) ;
176
176
177
177
it ( 'promotes the release in github' , async function ( ) {
178
- await runPublish (
178
+ await publishMongosh (
179
179
config ,
180
180
githubRepo ,
181
181
mongoHomebrewCoreForkRepo ,
182
182
homebrewCoreRepo ,
183
183
barque ,
184
184
createAndPublishDownloadCenterConfig ,
185
- publishNpmPackages ,
185
+ publishToNpm ,
186
186
writeBuildInfo ,
187
187
publishToHomebrew ,
188
188
shouldDoPublicRelease
@@ -192,34 +192,32 @@ describe('publish', function () {
192
192
} ) ;
193
193
194
194
it ( 'writes analytics config and then publishes NPM packages' , async function ( ) {
195
- await runPublish (
195
+ await publishMongosh (
196
196
config ,
197
197
githubRepo ,
198
198
mongoHomebrewCoreForkRepo ,
199
199
homebrewCoreRepo ,
200
200
barque ,
201
201
createAndPublishDownloadCenterConfig ,
202
- publishNpmPackages ,
202
+ publishToNpm ,
203
203
writeBuildInfo ,
204
204
publishToHomebrew ,
205
205
shouldDoPublicRelease
206
206
) ;
207
207
208
208
expect ( writeBuildInfo ) . to . have . been . calledOnceWith ( config ) ;
209
- expect ( publishNpmPackages ) . to . have . been . calledWith ( ) ;
210
- expect ( publishNpmPackages ) . to . have . been . calledAfter (
211
- writeBuildInfo as any
212
- ) ;
209
+ expect ( publishToNpm ) . to . have . been . calledWith ( ) ;
210
+ expect ( publishToNpm ) . to . have . been . calledAfter ( writeBuildInfo as any ) ;
213
211
} ) ;
214
212
it ( 'publishes to homebrew' , async function ( ) {
215
- await runPublish (
213
+ await publishMongosh (
216
214
config ,
217
215
githubRepo ,
218
216
mongoHomebrewCoreForkRepo ,
219
217
homebrewCoreRepo ,
220
218
barque ,
221
219
createAndPublishDownloadCenterConfig ,
222
- publishNpmPackages ,
220
+ publishToNpm ,
223
221
writeBuildInfo ,
224
222
publishToHomebrew ,
225
223
shouldDoPublicRelease
@@ -242,14 +240,14 @@ describe('publish', function () {
242
240
} ) ;
243
241
244
242
it ( 'does not update the download center config' , async function ( ) {
245
- await runPublish (
243
+ await publishMongosh (
246
244
config ,
247
245
githubRepo ,
248
246
mongoHomebrewCoreForkRepo ,
249
247
homebrewCoreRepo ,
250
248
barque ,
251
249
createAndPublishDownloadCenterConfig ,
252
- publishNpmPackages ,
250
+ publishToNpm ,
253
251
writeBuildInfo ,
254
252
publishToHomebrew ,
255
253
shouldDoPublicRelease
@@ -259,14 +257,14 @@ describe('publish', function () {
259
257
} ) ;
260
258
261
259
it ( 'does not promote the release in github' , async function ( ) {
262
- await runPublish (
260
+ await publishMongosh (
263
261
config ,
264
262
githubRepo ,
265
263
mongoHomebrewCoreForkRepo ,
266
264
homebrewCoreRepo ,
267
265
barque ,
268
266
createAndPublishDownloadCenterConfig ,
269
- publishNpmPackages ,
267
+ publishToNpm ,
270
268
writeBuildInfo ,
271
269
publishToHomebrew ,
272
270
shouldDoPublicRelease
@@ -276,31 +274,31 @@ describe('publish', function () {
276
274
} ) ;
277
275
278
276
it ( 'does not publish npm packages' , async function ( ) {
279
- await runPublish (
277
+ await publishMongosh (
280
278
config ,
281
279
githubRepo ,
282
280
mongoHomebrewCoreForkRepo ,
283
281
homebrewCoreRepo ,
284
282
barque ,
285
283
createAndPublishDownloadCenterConfig ,
286
- publishNpmPackages ,
284
+ publishToNpm ,
287
285
writeBuildInfo ,
288
286
publishToHomebrew ,
289
287
shouldDoPublicRelease
290
288
) ;
291
289
292
- expect ( publishNpmPackages ) . not . to . have . been . called ;
290
+ expect ( publishToNpm ) . not . to . have . been . called ;
293
291
} ) ;
294
292
295
293
it ( 'does not publish to homebrew' , async function ( ) {
296
- await runPublish (
294
+ await publishMongosh (
297
295
config ,
298
296
githubRepo ,
299
297
mongoHomebrewCoreForkRepo ,
300
298
homebrewCoreRepo ,
301
299
barque ,
302
300
createAndPublishDownloadCenterConfig ,
303
- publishNpmPackages ,
301
+ publishToNpm ,
304
302
writeBuildInfo ,
305
303
publishToHomebrew ,
306
304
shouldDoPublicRelease
@@ -310,14 +308,14 @@ describe('publish', function () {
310
308
} ) ;
311
309
312
310
it ( 'does not release to barque' , async function ( ) {
313
- await runPublish (
311
+ await publishMongosh (
314
312
config ,
315
313
githubRepo ,
316
314
mongoHomebrewCoreForkRepo ,
317
315
homebrewCoreRepo ,
318
316
barque ,
319
317
createAndPublishDownloadCenterConfig ,
320
- publishNpmPackages ,
318
+ publishToNpm ,
321
319
writeBuildInfo ,
322
320
publishToHomebrew ,
323
321
shouldDoPublicRelease
0 commit comments