Merge branch 'io' into merge-upstream
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
redistest:
|
||||
image: redis:7
|
||||
keydbtest:
|
||||
image: eqalpha/keydb:latest
|
||||
ports:
|
||||
- "127.0.0.1:56312:6379"
|
||||
|
||||
dbtest:
|
||||
image: postgres:13
|
||||
image: postgres:15
|
||||
ports:
|
||||
- "127.0.0.1:54312:5432"
|
||||
environment:
|
||||
|
@@ -21,9 +21,10 @@ import type { TestingModule } from '@nestjs/testing';
|
||||
function mockRedis() {
|
||||
const hash = {};
|
||||
const set = jest.fn((key, value) => {
|
||||
const ret = hash[key];
|
||||
// このテストで呼び出すSETにはNXオプションが付いてる
|
||||
if (hash[key]) return null;
|
||||
hash[key] = value;
|
||||
return ret;
|
||||
return 'OK';
|
||||
});
|
||||
return set;
|
||||
}
|
||||
|
Reference in New Issue
Block a user