Skip to content

Commit 7260add

Browse files
committed
test(dryBinary): change binary versions used to dummy versions
1 parent 4fbd110 commit 7260add

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/mongodb-memory-server-core/src/util/__tests__/dryBinary.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('DryBinary', () => {
5151
/** Used for non "find-cache-dir" */
5252
let tmpDir2: tmp.DirResult;
5353
const cwdBefore = process.cwd();
54-
const version = '4.0.25';
54+
const version = '1.1.1';
5555
let opts: binary.DryMongoBinaryOptions & binary.DryMongoBinaryNameOptions;
5656
let binaryName: string;
5757
beforeAll(async () => {
@@ -160,7 +160,7 @@ describe('DryBinary', () => {
160160
let expectedPaths: binary.DryMongoBinaryPaths;
161161
let opts: Required<binary.DryMongoBinaryOptions>;
162162
beforeAll(async () => {
163-
opts = await binary.DryMongoBinary.generateOptions({ version: '4.0.25' });
163+
opts = await binary.DryMongoBinary.generateOptions({ version: '1.1.1' });
164164
delete process.env[envName(ResolveConfigVariables.PREFER_GLOBAL_PATH)];
165165
jest.spyOn(utils, 'pathExists').mockImplementation((file) => {
166166
// this is to ensure it is returning an promise
@@ -339,7 +339,7 @@ describe('DryBinary', () => {
339339
process.env[envName(ResolveConfigVariables.SYSTEM_BINARY)] = mockBinary;
340340
jest.spyOn(fspromises, 'access').mockResolvedValue(void 0);
341341

342-
const returnValue = await binary.DryMongoBinary.locateBinary({ version: '4.0.25' });
342+
const returnValue = await binary.DryMongoBinary.locateBinary({ version: '1.1.1' });
343343
expect(returnValue).toEqual(mockBinary);
344344
expect(binary.DryMongoBinary.binaryCache.size).toBe(0); // system binaries dont get added to the cache
345345
expect(fspromises.access).toHaveBeenCalled();
@@ -351,7 +351,7 @@ describe('DryBinary', () => {
351351
jest.spyOn(fspromises, 'access').mockRejectedValue(new Error('custom'));
352352

353353
try {
354-
await binary.DryMongoBinary.locateBinary({ version: '4.0.25' });
354+
await binary.DryMongoBinary.locateBinary({ version: '1.1.1' });
355355
fail('Expected "locateBinary" to throw');
356356
} catch (err) {
357357
expect(err).toBeInstanceOf(NoSystemBinaryFoundError);
@@ -364,19 +364,19 @@ describe('DryBinary', () => {
364364
it('should return "undefined" if no binary can be found', async () => {
365365
jest.spyOn(binary.DryMongoBinary, 'generateDownloadPath').mockResolvedValue([false, 'empty']);
366366

367-
const returnValue = await binary.DryMongoBinary.locateBinary({ version: '4.0.25' });
367+
const returnValue = await binary.DryMongoBinary.locateBinary({ version: '1.1.1' });
368368
expect(returnValue).toBeUndefined();
369369
expect(binary.DryMongoBinary.binaryCache.size).toBe(0);
370370
expect(binary.DryMongoBinary.generateDownloadPath).toHaveBeenCalled();
371371
});
372372

373373
it('should return cached version if exists', async () => {
374374
const mockBinary = '/custom/path';
375-
binary.DryMongoBinary.binaryCache.set('4.0.25', mockBinary);
375+
binary.DryMongoBinary.binaryCache.set('1.1.1', mockBinary);
376376
jest.spyOn(binary.DryMongoBinary.binaryCache, 'get');
377377
jest.spyOn(binary.DryMongoBinary.binaryCache, 'has');
378378

379-
const returnValue = await binary.DryMongoBinary.locateBinary({ version: '4.0.25' });
379+
const returnValue = await binary.DryMongoBinary.locateBinary({ version: '1.1.1' });
380380
expect(returnValue).toEqual(mockBinary);
381381
expect(binary.DryMongoBinary.binaryCache.size).toBe(1);
382382
expect(binary.DryMongoBinary.binaryCache.has).toBeCalledTimes(1);
@@ -390,7 +390,7 @@ describe('DryBinary', () => {
390390
.spyOn(binary.DryMongoBinary, 'generateDownloadPath')
391391
.mockResolvedValue([true, mockBinary]);
392392

393-
const returnValue = await binary.DryMongoBinary.locateBinary({ version: '4.0.25' });
393+
const returnValue = await binary.DryMongoBinary.locateBinary({ version: '1.1.1' });
394394
expect(returnValue).toEqual(mockBinary);
395395
expect(binary.DryMongoBinary.binaryCache.size).toBe(1);
396396
expect(binary.DryMongoBinary.binaryCache.has).toBeCalledTimes(1);

0 commit comments

Comments
 (0)