Skip to content

Commit

Permalink
remove magic number
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Jan 6, 2025
1 parent 2097532 commit 6486222
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test/equipment.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import assert from 'node:assert';
import { randomUUID } from 'node:crypto';
import { after, describe, it } from 'node:test';
import { releaseAll } from '@cityssm/mssql-multi-pool';
import { millisToSeconds } from '@cityssm/to-millis';
import { WorkTechAPI } from '../index.js';
import { equipmentToAdd, invalidEquipmentId, mssqlConfig, validEquipmentDepartment, validEquipmentId } from './config.js';
await describe('queries/equipment', async () => {
Expand All @@ -20,7 +21,7 @@ await describe('queries/equipment', async () => {
assert.strictEqual(equipment, undefined);
});
await it('Adds a new piece of equipment, then updates it.', async () => {
const equipmentId = `TEST-${Math.round(Date.now() / 1000).toString()}`;
const equipmentId = `TEST-${Math.round(millisToSeconds(Date.now())).toString()}`;
const equipmentDescription = randomUUID();
console.log(`Adding new equipment: ${equipmentId}`);
const equipmentRecord = Object.assign({
Expand Down
3 changes: 2 additions & 1 deletion test/equipment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { randomUUID } from 'node:crypto'
import { after, describe, it } from 'node:test'

import { releaseAll } from '@cityssm/mssql-multi-pool'
import { millisToSeconds } from '@cityssm/to-millis'

import { WorkTechAPI } from '../index.js'
import type { AddEquipment } from '../queries/equipment/addEquipment.js'
Expand Down Expand Up @@ -40,7 +41,7 @@ await describe('queries/equipment', async () => {
})

await it('Adds a new piece of equipment, then updates it.', async () => {
const equipmentId = `TEST-${Math.round(Date.now() / 1000).toString()}`
const equipmentId = `TEST-${Math.round(millisToSeconds(Date.now())).toString()}`
const equipmentDescription = randomUUID()

console.log(`Adding new equipment: ${equipmentId}`)
Expand Down

0 comments on commit 6486222

Please sign in to comment.