mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-05 00:23:15 +08:00
Simplify mkdirP implementation (#781)
Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user