mirror of
https://github.com/waku-org/js-waku.git
synced 2025-02-17 06:47:29 +00:00
test: nwaku's store now reject messages older than 20s
This commit is contained in:
parent
862a33f239
commit
c3c3833b1b
@ -385,21 +385,21 @@ describe("Waku Store", () => {
|
|||||||
const now = new Date();
|
const now = new Date();
|
||||||
|
|
||||||
const startTime = new Date();
|
const startTime = new Date();
|
||||||
// Set start time 5 minutes in the past
|
// Set start time 15 seconds in the past
|
||||||
startTime.setTime(now.getTime() - 5 * 60 * 1000);
|
startTime.setTime(now.getTime() - 15 * 1000);
|
||||||
|
|
||||||
const message1Timestamp = new Date();
|
const message1Timestamp = new Date();
|
||||||
// Set first message was 4 minutes in the past
|
// Set first message was 10 seconds in the past
|
||||||
message1Timestamp.setTime(now.getTime() - 4 * 60 * 1000);
|
message1Timestamp.setTime(now.getTime() - 10 * 1000);
|
||||||
|
|
||||||
const message2Timestamp = new Date();
|
const message2Timestamp = new Date();
|
||||||
// Set second message 2 minutes in the past
|
// Set second message 2 seconds in the past
|
||||||
message2Timestamp.setTime(now.getTime() - 2 * 60 * 1000);
|
message2Timestamp.setTime(now.getTime() - 2 * 1000);
|
||||||
const messageTimestamps = [message1Timestamp, message2Timestamp];
|
const messageTimestamps = [message1Timestamp, message2Timestamp];
|
||||||
|
|
||||||
const endTime = new Date();
|
const endTime = new Date();
|
||||||
// Set end time 1 minute in the past
|
// Set end time 1 second in the past
|
||||||
endTime.setTime(now.getTime() - 60 * 1000);
|
endTime.setTime(now.getTime() - 1000);
|
||||||
|
|
||||||
for (let i = 0; i < 2; i++) {
|
for (let i = 0; i < 2; i++) {
|
||||||
expect(
|
expect(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user