Skip to content

Commit

Permalink
chore: remove fmfr, use rimraf in all tests
Browse files Browse the repository at this point in the history
For some reason we had both rmfr and rimraf. Use just
rimraf's latest version.
  • Loading branch information
tkurki committed Dec 8, 2024
1 parent 27ad435 commit c55bd44
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
"@types/mocha": "^10.0.1",
"@types/ncp": "^2.0.5",
"@types/node-fetch": "^2.5.3",
"@types/rmfr": "^2.0.1",
"@types/semver": "^7.1.0",
"@types/serialport": "^8.0.2",
"@types/split": "^1.0.0",
Expand All @@ -168,8 +167,7 @@
"lint-staged": "^10.0.3",
"mocha": "^10.2.0",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"rmfr": "^2.0.0",
"rimraf": "^6.0.1",
"ts-node": "^10.9.1",
"typedoc": "^0.26.11",
"typescript": "5.6.x"
Expand Down
18 changes: 5 additions & 13 deletions test/applicationData.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const fs = require('fs')
const promisify = require('util').promisify
const path = require('path')
const assert = require('assert')
const rimraf = require('rimraf')
const rimraf = require('rimraf').rimraf

const APP_ID = 'testApplication'
const APP_VERSION = '1.0.0'
Expand Down Expand Up @@ -83,18 +83,10 @@ describe('Application Data', () => {
Cookie: `JAUTHENTICATION=${adminToken}`
}

await new Promise((resolve, reject) => {
rimraf(path.join(
process.env.SIGNALK_NODE_CONFIG_DIR,
'applicationData'), error => {
if ( error ) {
reject(error)
} else {
resolve()
}
})
})

await rimraf(
path.join(process.env.SIGNALK_NODE_CONFIG_DIR, 'applicationData')
)

return server
}

Expand Down
4 changes: 2 additions & 2 deletions test/ts-servertestutilities.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import freeport from 'freeport-promise'
import fetch from 'node-fetch'
import path from 'path'
import rmfr from 'rmfr'
import { rimraf } from 'rimraf'
import {
sendDelta,
serverTestConfigDirectory,
Expand All @@ -18,7 +18,7 @@ const emptyConfigDirectory = () =>
Promise.all(
[SERVERSTATEDIRNAME, 'resources', 'plugin-config-data', 'baseDeltas.json']
.map(subDir => path.join(serverTestConfigDirectory(), subDir))
.map(dir => rmfr(dir).then(() => console.error(dir)))
.map(dir => rimraf(dir).then(() => console.error(dir)))
)

export const startServer = async () => {
Expand Down

0 comments on commit c55bd44

Please sign in to comment.