Simplify mkdirP implementation (#444)

This commit is contained in:
Linus Unnebäck
2021-04-28 20:24:23 +02:00
committed by GitHub
parent 4bf916289e
commit e9c6ee99a5
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', () => {
it('copies file with no flags', async () => {
@@ -813,31 +812,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', () => {