Skip to content

Commit

Permalink
try out citysm/to-millis
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Oct 29, 2024
1 parent 80c60d1 commit c7ccdfe
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"@cityssm/fa-glow": "^0.1.0",
"@cityssm/mssql-multi-pool": "^4.0.0",
"@cityssm/simple-fa5-checkbox": "^0.2.1",
"@cityssm/to-millis": "^0.1.0",
"@types/activedirectory2": "^1.2.6",
"@types/better-sqlite3": "^7.6.11",
"@types/compression": "^1.7.5",
Expand Down
6 changes: 4 additions & 2 deletions test/1_serverCypress.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
import assert from 'node:assert';
import { exec } from 'node:child_process';
import http from 'node:http';
import { minutesToMillis } from '@cityssm/to-millis';
import { app } from '../app.js';
import { portNumber } from './_globals.js';
function runCypress(browser, done) {
let cypressCommand = `cypress run --config-file cypress.config.js --browser ${browser}`;
if ((process.env.CYPRESS_RECORD_KEY ?? '') !== '') {
cypressCommand += ` --tag "${browser},${process.version}" --record`;
}
// eslint-disable-next-line security/detect-child-process, sonarjs/os-command
const childProcess = exec(cypressCommand);
childProcess.stdout?.on('data', (data) => {
console.log(data);
Expand Down Expand Up @@ -44,9 +46,9 @@ describe('lot-occupancy-system', () => {
describe('Cypress tests', () => {
it('Should run Cypress tests in Chrome', (done) => {
runCypress('chrome', done);
}).timeout(30 * 60 * 60 * 1000);
}).timeout(minutesToMillis(30));
it('Should run Cypress tests in Firefox', (done) => {
runCypress('firefox', done);
}).timeout(30 * 60 * 60 * 1000);
}).timeout(minutesToMillis(30));
});
});
7 changes: 5 additions & 2 deletions test/1_serverCypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import assert from 'node:assert'
import { exec } from 'node:child_process'
import http from 'node:http'

import { minutesToMillis } from '@cityssm/to-millis'

import { app } from '../app.js'

import { portNumber } from './_globals.js'
Expand All @@ -15,6 +17,7 @@ function runCypress(browser: 'chrome' | 'firefox', done: () => void): void {
cypressCommand += ` --tag "${browser},${process.version}" --record`
}

// eslint-disable-next-line security/detect-child-process, sonarjs/os-command
const childProcess = exec(cypressCommand)

childProcess.stdout?.on('data', (data) => {
Expand Down Expand Up @@ -59,10 +62,10 @@ describe('lot-occupancy-system', () => {
describe('Cypress tests', () => {
it('Should run Cypress tests in Chrome', (done) => {
runCypress('chrome', done)
}).timeout(30 * 60 * 60 * 1000)
}).timeout(minutesToMillis(30))

it('Should run Cypress tests in Firefox', (done) => {
runCypress('firefox', done)
}).timeout(30 * 60 * 60 * 1000)
}).timeout(minutesToMillis(30))
})
})

0 comments on commit c7ccdfe

Please sign in to comment.