mirror of https://github.com/actions/toolkit
pull/1344/head
parent
19e20568d3
commit
1f17f8bd0b
|
@ -5,7 +5,11 @@ import * as path from 'path'
|
||||||
import * as io from '../src/io'
|
import * as io from '../src/io'
|
||||||
|
|
||||||
describe('cp', () => {
|
describe('cp', () => {
|
||||||
beforeAll(async () => {
|
beforeEach(async () => {
|
||||||
|
await io.mkdirP(getTestTemp())
|
||||||
|
})
|
||||||
|
|
||||||
|
afterEach(async () => {
|
||||||
await io.rmRF(getTestTemp())
|
await io.rmRF(getTestTemp())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -192,7 +196,11 @@ describe('cp', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('mv', () => {
|
describe('mv', () => {
|
||||||
beforeAll(async () => {
|
beforeEach(async () => {
|
||||||
|
await io.mkdirP(getTestTemp())
|
||||||
|
})
|
||||||
|
|
||||||
|
afterEach(async () => {
|
||||||
await io.rmRF(getTestTemp())
|
await io.rmRF(getTestTemp())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -294,7 +302,11 @@ describe('mv', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('rmRF', () => {
|
describe('rmRF', () => {
|
||||||
beforeAll(async () => {
|
beforeEach(async () => {
|
||||||
|
await io.mkdirP(getTestTemp())
|
||||||
|
})
|
||||||
|
|
||||||
|
afterEach(async () => {
|
||||||
await io.rmRF(getTestTemp())
|
await io.rmRF(getTestTemp())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -332,7 +344,6 @@ describe('rmRF', () => {
|
||||||
await assertExists(filePath)
|
await assertExists(filePath)
|
||||||
|
|
||||||
const fd = await fs.open(filePath, 'r')
|
const fd = await fs.open(filePath, 'r')
|
||||||
console.log(fd)
|
|
||||||
await io.rmRF(testPath)
|
await io.rmRF(testPath)
|
||||||
|
|
||||||
await assertNotExists(testPath)
|
await assertNotExists(testPath)
|
||||||
|
@ -738,7 +749,11 @@ describe('rmRF', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('mkdirP', () => {
|
describe('mkdirP', () => {
|
||||||
beforeAll(async () => {
|
beforeEach(async () => {
|
||||||
|
await io.mkdirP(getTestTemp())
|
||||||
|
})
|
||||||
|
|
||||||
|
afterEach(async () => {
|
||||||
await io.rmRF(getTestTemp())
|
await io.rmRF(getTestTemp())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -876,7 +891,11 @@ describe('mkdirP', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('which', () => {
|
describe('which', () => {
|
||||||
beforeAll(async () => {
|
beforeEach(async () => {
|
||||||
|
await io.mkdirP(getTestTemp())
|
||||||
|
})
|
||||||
|
|
||||||
|
afterEach(async () => {
|
||||||
await io.rmRF(getTestTemp())
|
await io.rmRF(getTestTemp())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1413,7 +1432,11 @@ describe('which', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('findInPath', () => {
|
describe('findInPath', () => {
|
||||||
beforeAll(async () => {
|
beforeEach(async () => {
|
||||||
|
await io.mkdirP(getTestTemp())
|
||||||
|
})
|
||||||
|
|
||||||
|
afterEach(async () => {
|
||||||
await io.rmRF(getTestTemp())
|
await io.rmRF(getTestTemp())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,6 @@ export async function rmRF(inputPath: string): Promise<void> {
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// if you try to delete a file that doesn't exist, desired result is achieved
|
// if you try to delete a file that doesn't exist, desired result is achieved
|
||||||
// other errors are valid
|
// other errors are valid
|
||||||
console.log(err)
|
|
||||||
if (err.code !== 'ENOENT') throw err
|
if (err.code !== 'ENOENT') throw err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue