Skip to content

Commit

Permalink
test(MongoInstance): add test for code 0 and code 12 for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Mar 17, 2023
1 parent 0668c35 commit 12fadef
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,30 @@ describe('MongodbInstance', () => {
}
});

it('should not emit "instanceError" with 0 or 12 exit code on windows', () => {
Object.defineProperty(process, 'platform', {
value: 'win32',
});

// test code 0
{
events.clear();
mongod.closeHandler(0, null);

expect(events.size).toEqual(1);
expect(events.get(MongoInstanceEvents.instanceClosed)).toEqual([0, null]);
}

// test code 12
{
events.clear();
mongod.closeHandler(12, null);

expect(events.size).toEqual(1);
expect(events.get(MongoInstanceEvents.instanceClosed)).toEqual([12, null]);
}
});

it('"closeHandler" should emit "instanceError" with vc_redist helper message on windows on high exit code', () => {
events.clear();
Object.defineProperty(process, 'platform', {
Expand Down

0 comments on commit 12fadef

Please sign in to comment.