Simplify mkdirP implementation (#781)

Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
This commit is contained in:
Thomas Boop
2021-04-28 14:38:41 -04:00
committed by GitHub
parent dd046652c3
commit 15fef78171
3 changed files with 3 additions and 74 deletions

View File

@@ -3,7 +3,6 @@ import {promises as fs} from 'fs'
import * as os from 'os'
import * as path from 'path'
import * as io from '../src/io'
import * as ioUtil from '../src/io-util'
describe('cp', () => {
beforeAll(async () => {
@@ -825,31 +824,6 @@ describe('mkdirP', () => {
(await fs.lstat(path.join(realDirPath, 'sub_dir'))).isDirectory()
).toBe(true)
})
it('breaks if mkdirP loop out of control', async () => {
const testPath = path.join(
getTestTemp(),
'mkdirP_failsafe',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'10'
)
expect.assertions(1)
try {
await ioUtil.mkdirP(testPath, 10)
} catch (err) {
expect(err.code).toBe('ENOENT')
}
})
})
describe('which', () => {