15 lines
425 B
TypeScript
15 lines
425 B
TypeScript
import { createHash } from 'crypto';
|
|
import { defineAuctionRedisScript } from './auction-redis.scripts';
|
|
|
|
describe('auction redis scripts', () => {
|
|
it('stores normalized Lua and its SHA1', () => {
|
|
const script = defineAuctionRedisScript('test', 'return 1\n');
|
|
|
|
expect(script).toEqual({
|
|
lua: 'return 1\n',
|
|
name: 'test',
|
|
sha: createHash('sha1').update('return 1\n').digest('hex'),
|
|
});
|
|
});
|
|
});
|