11import { strict as assert } from 'node:assert' ;
2- import testUtils , { GLOBAL , sleep } from '../test-utils' ;
2+ import testUtils , { GLOBAL } from '../test-utils' ;
33import { BasicCommandParser } from '../client/parser' ;
44import HGETEX from './HGETEX' ;
5+ import { setTimeout } from 'timers/promises' ;
56
67describe ( 'HGETEX parseCommand' , ( ) => {
78 it ( 'hGetEx parseCommand base' , ( ) => {
@@ -36,30 +37,28 @@ describe('HGETEX parseCommand', () => {
3637} ) ;
3738
3839
39- // TODO: enable when new test container is released
40- describe . skip ( 'HGETEX call' , ( ) => {
40+ describe ( 'HGETEX call' , ( ) => {
4141 testUtils . testWithClientIfVersionWithinRange ( [ [ 8 ] , 'LATEST' ] , 'hGetEx empty single field' , async client => {
4242 assert . deepEqual (
43- await client . hGetEx ( 'key' , 'filed1 ' , { expiration : 'PERSIST' } ) ,
43+ await client . hGetEx ( 'key' , 'field1 ' , { expiration : 'PERSIST' } ) ,
4444 [ null ]
4545 ) ;
4646 } , GLOBAL . SERVERS . OPEN ) ;
4747
4848 testUtils . testWithClientIfVersionWithinRange ( [ [ 8 ] , 'LATEST' ] , 'hGetEx empty multiple fields' , async client => {
4949 assert . deepEqual (
50- await client . hGetEx ( 'key' , [ 'filed1 ' , 'field2' ] , { expiration : 'PERSIST' } ) ,
50+ await client . hGetEx ( 'key' , [ 'field1 ' , 'field2' ] , { expiration : 'PERSIST' } ) ,
5151 [ null , null ]
5252 ) ;
5353 } , GLOBAL . SERVERS . OPEN ) ;
5454
5555 testUtils . testWithClientIfVersionWithinRange ( [ [ 8 ] , 'LATEST' ] , 'hGetEx set expiry' , async client => {
5656 await client . hSet ( 'key' , 'field' , 'value' )
5757 assert . deepEqual (
58- await client . hGetEx ( 'key' , 'field' , { expiration : { type : 'PX' , value : 500 } } ) ,
58+ await client . hGetEx ( 'key' , 'field' , { expiration : { type : 'PX' , value : 50 } } ) ,
5959 [ 'value' ]
6060 ) ;
61-
62- await sleep ( 600 )
61+ await setTimeout ( 100 )
6362 assert . deepEqual (
6463 await client . hGet ( 'key' , 'field' ) ,
6564 null
@@ -68,9 +67,9 @@ describe.skip('HGETEX call', () => {
6867
6968 testUtils . testWithClientIfVersionWithinRange ( [ [ 8 ] , 'LATEST' ] , 'gGetEx set expiry PERSIST' , async client => {
7069 await client . hSet ( 'key' , 'field' , 'value' )
71- await client . hGetEx ( 'key' , 'field' , { expiration : { type : 'PX' , value : 500 } } )
70+ await client . hGetEx ( 'key' , 'field' , { expiration : { type : 'PX' , value : 50 } } )
7271 await client . hGetEx ( 'key' , 'field' , { expiration : 'PERSIST' } )
73- await sleep ( 600 )
72+ await setTimeout ( 100 )
7473 assert . deepEqual (
7574 await client . hGet ( 'key' , 'field' ) ,
7675 'value'
0 commit comments