@samitouri / QOSami-HFS / commits / 9b5bcc7e

test: fix error cleaning up

Massimo Melina committed Dec 19, 2023 at 23:30 UTC 9b5bcc7e4a99c12ead89bc8b6da6063a5960de06
1 file changed +3 -2
tests/test.ts
+3 -2
@@ -1,9 +1,10 @@
1 import { srpClientSequence } from '../src/srp'
2 -import { createReadStream, rmSync } from 'fs'
2 +import { createReadStream } from 'fs'
3 import { dirname, join } from 'path'
4 import _ from 'lodash'
5 import { findDefined, tryJson } from '../src/cross'
6 import { httpStream, stream2string, XRequestOptions } from '../src/util-http'
7 +import { rm } from 'fs/promises'
8 /*
9 import { PORT, srv } from '../src'
10
@@ -123,7 +124,7 @@ describe('after-login', () => {
124 it('delete.ok', reqApi('delete', { uri: dirname(UPLOAD_DEST) + '/' + renameTo }, 200))
125 it('delete.miss deleted', reqApi('delete', { uri: UPLOAD_DEST }, 404))
126 after(() =>
126 - rmSync(join(__dirname, 'temp'), { recursive: true}))
127 + rm(join(__dirname, 'temp'), { recursive: true}).catch(() => 0))
128 })
129
130 function login(usr: string, pwd=password) {