Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
u1-liquid committed Mar 15, 2024
1 parent 27dd6aa commit 4fc2f3e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/backend/test/unit/FetchInstanceMetadataService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import type { TestingModule } from '@nestjs/testing';

function mockRedis() {
const hash = {} as FIXME;
return jest.fn((key: string, value): Promise<'OK'> => {
return new Promise((resolve, reject) => {
return jest.fn((key: string, value): Promise<'OK' | null> => {
return new Promise(resolve => {
// このテストで呼び出すSETにはNXオプションが付いてる
if (hash[key]) return reject(null);
if (hash[key]) return resolve(null);
hash[key] = value;
resolve('OK');
});
Expand Down

0 comments on commit 4fc2f3e

Please sign in to comment.