Skip to content

Commit d741f6a

Browse files
committed
wip
1 parent da809a5 commit d741f6a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

packages/build/src/npm-packages/publish.spec.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ describe('npm-packages publishToNpm', function () {
2323
getPackagesInTopologicalOrder = sinon.stub();
2424
markBumpedFilesAsAssumeUnchanged = sinon.stub();
2525
spawnSync = sinon.stub();
26+
process.env.MONGOSH_RELEASE_PUBLISHER = 'test-publisher';
2627
});
2728

2829
it('throws if mongosh is not existent when publishing all', async function () {
@@ -42,6 +43,28 @@ describe('npm-packages publishToNpm', function () {
4243
}
4344
});
4445

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+
4568
it('takes mongosh version and pushes tags', async function () {
4669
const packages = [
4770
{ name: 'packageA', version: '0.7.0' },

0 commit comments

Comments
 (0)