1
0
Fork 0
mirror of synced 2024-08-23 05:51:29 +12:00

Fix tests depending on date

This commit is contained in:
Adria Navarro 2024-05-13 11:03:15 +02:00
parent efaedbccde
commit ae83bb695e

View file

@ -44,7 +44,7 @@ describe.each([
const snippets = [
{
name: "WeeksAgo",
code: "return function (weeks) {\n const currentTime = new Date();\n currentTime.setDate(currentTime.getDate()-(7 * (weeks || 1)));\n return currentTime.toISOString();\n}",
code: `return function (weeks) {\n const currentTime = new Date(${Date.now()});\n currentTime.setDate(currentTime.getDate()-(7 * (weeks || 1)));\n return currentTime.toISOString();\n}`,
},
]