@@ -23,6 +23,7 @@ describe('npm-packages publishToNpm', function () {
23
23
getPackagesInTopologicalOrder = sinon . stub ( ) ;
24
24
markBumpedFilesAsAssumeUnchanged = sinon . stub ( ) ;
25
25
spawnSync = sinon . stub ( ) ;
26
+ process . env . MONGOSH_RELEASE_PUBLISHER = 'test-publisher' ;
26
27
} ) ;
27
28
28
29
it ( 'throws if mongosh is not existent when publishing all' , async function ( ) {
@@ -42,6 +43,28 @@ describe('npm-packages publishToNpm', function () {
42
43
}
43
44
} ) ;
44
45
46
+ it ( 'throws if publisher is not set when publishing all' , async function ( ) {
47
+ const packages = [
48
+ { name : 'packageA' , version : '0.7.0' } ,
49
+ { name : 'mongosh' , version : '1.2.0' } ,
50
+ ] ;
51
+ getPackagesInTopologicalOrder . resolves ( packages ) ;
52
+
53
+ try {
54
+ await publishNpmPackages (
55
+ { isDryRun : false , useAuxiliaryPackagesOnly : false } ,
56
+ getPackagesInTopologicalOrder ,
57
+ markBumpedFilesAsAssumeUnchanged ,
58
+ spawnSync
59
+ ) ;
60
+ expect . fail ( 'should throw' ) ;
61
+ } catch ( error ) {
62
+ expect ( ( error as Error ) . message ) . equals (
63
+ 'MONGOSH_RELEASE_PUBLISHER is required for publishing mongosh'
64
+ ) ;
65
+ }
66
+ } ) ;
67
+
45
68
it ( 'takes mongosh version and pushes tags' , async function ( ) {
46
69
const packages = [
47
70
{ name : 'packageA' , version : '0.7.0' } ,
0 commit comments