@@ -32,7 +32,7 @@ describe("Timezone Edge Cases", () => {
3232 it ( "should handle dates with explicit timezone offsets" , async ( ) => {
3333 // User passes date with timezone offset
3434 const dateWithOffset = new Date ( "2024-01-15T14:00:00+02:00" ) // 2 PM in +2 timezone = 12 PM UTC
35-
35+
3636 const job = await adapter . addJob ( {
3737 name : "offset-test" ,
3838 payload : { test : "data" } ,
@@ -53,7 +53,7 @@ describe("Timezone Edge Cases", () => {
5353 it ( "should handle negative timezone offsets" , async ( ) => {
5454 // User passes date with negative timezone offset
5555 const dateWithNegativeOffset = new Date ( "2024-01-15T14:00:00-05:00" ) // 2 PM EST = 7 PM UTC
56-
56+
5757 const job = await adapter . addJob ( {
5858 name : "negative-offset-test" ,
5959 payload : { test : "data" } ,
@@ -75,7 +75,7 @@ describe("Timezone Edge Cases", () => {
7575 // Simulate server running in different timezone by creating dates in different ways
7676 const utcDate = new Date ( "2024-01-15T14:00:00Z" ) // Explicit UTC
7777 const localDate = new Date ( "2024-01-15T14:00:00" ) // Local time (depends on server timezone)
78-
78+
7979 const utcJob = await adapter . addJob ( {
8080 name : "utc-job" ,
8181 payload : { type : "utc" } ,
@@ -89,7 +89,7 @@ describe("Timezone Edge Cases", () => {
8989 } )
9090
9191 const localJob = await adapter . addJob ( {
92- name : "local-job" ,
92+ name : "local-job" ,
9393 payload : { type : "local" } ,
9494 status : "pending" ,
9595 priority : 2 ,
@@ -102,7 +102,7 @@ describe("Timezone Edge Cases", () => {
102102
103103 // UTC date should be stored exactly as provided
104104 expect ( utcJob . processAt . toISOString ( ) ) . toBe ( "2024-01-15T14:00:00.000Z" )
105-
105+
106106 // Local date gets stored as whatever the server interprets it as
107107 // This is the key test - we store whatever Date object represents in UTC
108108 expect ( localJob . processAt ) . toBeInstanceOf ( Date )
@@ -112,8 +112,8 @@ describe("Timezone Edge Cases", () => {
112112 it ( "should handle daylight saving time transitions" , async ( ) => {
113113 // Spring forward: March 10, 2024 in America/New_York
114114 const springForwardDate = new Date ( "2024-03-10T07:00:00Z" ) // 2 AM EST becomes 3 AM EDT
115-
116- // Fall back: November 3, 2024 in America/New_York
115+
116+ // Fall back: November 3, 2024 in America/New_York
117117 const fallBackDate = new Date ( "2024-11-03T06:00:00Z" ) // 2 AM EDT becomes 1 AM EST
118118
119119 const springJob = await adapter . addJob ( {
@@ -131,7 +131,7 @@ describe("Timezone Edge Cases", () => {
131131 const fallJob = await adapter . addJob ( {
132132 name : "fall-job" ,
133133 payload : { dst : "fall" } ,
134- status : "pending" ,
134+ status : "pending" ,
135135 priority : 2 ,
136136 attempts : 0 ,
137137 maxAttempts : 3 ,
@@ -150,28 +150,28 @@ describe("Timezone Edge Cases", () => {
150150 {
151151 name : "ISO with Z" ,
152152 date : new Date ( "2024-01-15T14:00:00Z" ) ,
153- expected : "2024-01-15T14:00:00.000Z"
153+ expected : "2024-01-15T14:00:00.000Z" ,
154154 } ,
155155 {
156156 name : "ISO with +00:00" ,
157157 date : new Date ( "2024-01-15T14:00:00+00:00" ) ,
158- expected : "2024-01-15T14:00:00.000Z"
158+ expected : "2024-01-15T14:00:00.000Z" ,
159159 } ,
160160 {
161161 name : "ISO with +02:00" ,
162162 date : new Date ( "2024-01-15T14:00:00+02:00" ) ,
163- expected : "2024-01-15T12:00:00.000Z" // 2 hours earlier in UTC
163+ expected : "2024-01-15T12:00:00.000Z" , // 2 hours earlier in UTC
164164 } ,
165165 {
166166 name : "ISO with -05:00" ,
167167 date : new Date ( "2024-01-15T14:00:00-05:00" ) ,
168- expected : "2024-01-15T19:00:00.000Z" // 5 hours later in UTC
168+ expected : "2024-01-15T19:00:00.000Z" , // 5 hours later in UTC
169169 } ,
170170 {
171171 name : "Timestamp" ,
172172 date : new Date ( 1705327200000 ) , // 2024-01-15T14:00:00Z
173- expected : "2024-01-15T14:00:00.000Z"
174- }
173+ expected : "2024-01-15T14:00:00.000Z" ,
174+ } ,
175175 ]
176176
177177 for ( const testCase of testCases ) {
@@ -195,7 +195,7 @@ describe("Timezone Edge Cases", () => {
195195 // Test that what goes in comes out exactly the same
196196 const originalTimestamp = 1705327200000 // 2024-01-15T14:00:00Z
197197 const originalDate = new Date ( originalTimestamp )
198-
198+
199199 const job = await adapter . addJob ( {
200200 name : "consistency-test" ,
201201 payload : { test : "data" } ,
@@ -210,9 +210,9 @@ describe("Timezone Edge Cases", () => {
210210
211211 // Retrieve the job
212212 const retrievedJob = await adapter . getNextJob ( )
213-
213+
214214 expect ( retrievedJob ) . toBeTruthy ( )
215215 expect ( retrievedJob ?. processAt . getTime ( ) ) . toBe ( originalTimestamp )
216216 expect ( retrievedJob ?. processAt . toISOString ( ) ) . toBe ( originalDate . toISOString ( ) )
217217 } )
218- } )
218+ } )
0 commit comments