diff --git a/test/orm/model_has_many.spec.ts b/test/orm/model_has_many.spec.ts index 2a5bd023..c275a220 100644 --- a/test/orm/model_has_many.spec.ts +++ b/test/orm/model_has_many.spec.ts @@ -8,6 +8,7 @@ */ import { test } from '@japa/runner' +import { DateTime } from 'luxon' import type { HasMany } from '../../src/types/relations.js' import { scope } from '../../src/orm/base_model/index.js' @@ -3716,6 +3717,8 @@ if (process.env.DB !== 'mysql_legacy') { const [user0, user1] = await db.query().from('users') + const now = DateTime.now() + /** * User 1 */ @@ -3726,27 +3729,27 @@ if (process.env.DB !== 'mysql_legacy') { { user_id: user0.id, title: 'Adonis 101', - created_at: new Date(), + created_at: now, }, { user_id: user0.id, title: 'Adonis 102', - created_at: new Date(), + created_at: now.plus({ seconds: 1 }), }, { user_id: user0.id, title: 'Adonis 103', - created_at: new Date(), + created_at: now.plus({ seconds: 2 }), }, { user_id: user0.id, title: 'Adonis 104', - created_at: new Date(), + created_at: now.plus({ seconds: 3 }), }, { user_id: user0.id, title: 'Adonis 105', - created_at: new Date(), + created_at: now.plus({ seconds: 4 }), }, ]) @@ -3760,27 +3763,27 @@ if (process.env.DB !== 'mysql_legacy') { { user_id: user1.id, title: 'Lucid 101', - created_at: new Date(), + created_at: now, }, { user_id: user1.id, title: 'Lucid 102', - created_at: new Date(), + created_at: now.plus({ seconds: 1 }), }, { user_id: user1.id, title: 'Lucid 103', - created_at: new Date(), + created_at: now.plus({ seconds: 2 }), }, { user_id: user1.id, title: 'Lucid 104', - created_at: new Date(), + created_at: now.plus({ seconds: 3 }), }, { user_id: user1.id, title: 'Lucid 105', - created_at: new Date(), + created_at: now.plus({ seconds: 4 }), }, ])