11import { describe , expect , beforeEach , test , vi } from 'vitest'
22import { setActivePinia , createPinia } from 'pinia'
3+ import { DateTime , Settings } from 'luxon'
34import axios from 'axios'
45import { useTranslator } from '../../stores/useTranslator'
56import type { DictionaryConfig , DictionaryEntries , DictionaryResponse } from '../../interfaces'
6- import { DateTime } from 'luxon'
77
88const testDictionaryConfig : DictionaryConfig = {
99 name : 'English' ,
@@ -288,6 +288,9 @@ describe('Date Tests', async () => {
288288 await load ( )
289289
290290 // Assert basic translate method
291+ // Force the default timezone, so the test is consistent regardless of
292+ // the timezone of the runner
293+ Settings . defaultZone = 'America/New_York'
291294 expect ( $tdate ( '2025-02-02T14:42:12.000000Z' ) ) . toBe ( 'Sun, Feb 2, 2025, 9:42 AM' )
292295 expect ( $tdate ( '2025-02-02T14:42:12.000000Z' , 'DDD' ) ) . toBe ( 'February 2, 2025' )
293296 expect ( $tdate ( '2025-02-02T14:42:12.000000Z' , DateTime . DATETIME_MED ) ) . toBe (
@@ -308,6 +311,9 @@ describe('Date Tests', async () => {
308311 await load ( )
309312
310313 // Assert basic translate method
314+ // Force the default timezone, so the test is consistent regardless of
315+ // the timezone of the runner
316+ Settings . defaultZone = 'America/New_York'
311317 expect ( $tdate ( '2025-02-02T14:42:12.000000Z' ) ) . toBe ( 'dim. 2 févr. 2025, 09:42' )
312318 expect ( $tdate ( '2025-02-02T14:42:12.000000Z' , 'DDD' ) ) . toBe ( '2 février 2025' )
313319 expect ( $tdate ( '2025-02-02T14:42:12.000000Z' , DateTime . DATETIME_MED ) ) . toBe (
0 commit comments