Fix tests depending on date

This commit is contained in:
Adria Navarro 2024-05-13 11:03:15 +02:00
parent efaedbccde
commit ae83bb695e
1 changed files with 1 additions and 1 deletions

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}`,
},
]