React to feedback
This commit is contained in:
+4
-15
@@ -1,24 +1,11 @@
|
||||
import * as io from '@actions/io'
|
||||
import {promises as fs} from 'fs'
|
||||
import * as path from 'path'
|
||||
import * as cacheUtils from '../src/internal/cacheUtils'
|
||||
|
||||
jest.mock('@actions/core')
|
||||
jest.mock('os')
|
||||
|
||||
function getTempDir(): string {
|
||||
return path.join(__dirname, '_temp', 'cacheUtils')
|
||||
}
|
||||
|
||||
afterAll(async () => {
|
||||
delete process.env['GITHUB_WORKSPACE']
|
||||
await io.rmRF(getTempDir())
|
||||
})
|
||||
|
||||
test('getArchiveFileSize returns file size', () => {
|
||||
test('getArchiveFileSizeIsBytes returns file size', () => {
|
||||
const filePath = path.join(__dirname, '__fixtures__', 'helloWorld.txt')
|
||||
|
||||
const size = cacheUtils.getArchiveFileSize(filePath)
|
||||
const size = cacheUtils.getArchiveFileSizeIsBytes(filePath)
|
||||
|
||||
expect(size).toBe(11)
|
||||
})
|
||||
@@ -28,6 +15,8 @@ test('unlinkFile unlinks file', async () => {
|
||||
const testFile = path.join(testDirectory, 'test.txt')
|
||||
await fs.writeFile(testFile, 'hello world')
|
||||
|
||||
await expect(fs.stat(testFile)).resolves.not.toThrow()
|
||||
|
||||
await cacheUtils.unlinkFile(testFile)
|
||||
|
||||
// This should throw as testFile should not exist
|
||||
|
||||
Reference in New Issue
Block a user