fix linter

This commit is contained in:
Conor Sloan
2023-11-17 21:38:11 +00:00
parent 1e8c61d3f5
commit 61de8fadb6
4 changed files with 20 additions and 10 deletions
+7 -7
View File
@@ -41,8 +41,8 @@ describe('createArchives', () => {
expect(tarFile.sha256.startsWith('sha256:')).toEqual(true)
// Validate the hashes by comparing to the output of the system's hashing utility
let zipSHA = zipFile.sha256.substring(7) // remove "sha256:" prefix
let tarSHA = tarFile.sha256.substring(7) // remove "sha256:" prefix
const zipSHA = zipFile.sha256.substring(7) // remove "sha256:" prefix
const tarSHA = tarFile.sha256.substring(7) // remove "sha256:" prefix
// sha256 hash is 64 characters long
expect(zipSHA).toHaveLength(64)
@@ -86,13 +86,13 @@ describe('createTempDir', () => {
})
afterEach(() => {
dirs.forEach(dir => {
for (const dir of dirs) {
fs.rmSync(dir, { recursive: true })
})
}
})
it('creates a temporary directory in the OS temporary dir', () => {
let tmpDir = fsHelper.createTempDir()
const tmpDir = fsHelper.createTempDir()
dirs.push(tmpDir)
expect(fs.existsSync(tmpDir)).toEqual(true)
@@ -101,10 +101,10 @@ describe('createTempDir', () => {
})
it('creates a unique temporary directory', () => {
let dir1 = fsHelper.createTempDir()
const dir1 = fsHelper.createTempDir()
dirs.push(dir1)
let dir2 = fsHelper.createTempDir()
const dir2 = fsHelper.createTempDir()
dirs.push(dir2)
expect(dir1).not.toEqual(dir2)
+2 -3
View File
@@ -1,6 +1,5 @@
import { publishOCIArtifact } from '../src/ghcr-client'
import axios, { AxiosRequestConfig } from 'axios'
import * as fs from 'fs'
import * as fsHelper from '../src/fs-helper'
import * as ociContainer from '../src/oci-container'
@@ -110,7 +109,7 @@ describe('publishOCIArtifact', () => {
})
// Simulate successful reading of all the files
fsReadFileSyncMock.mockImplementation(async path => {
fsReadFileSyncMock.mockImplementation(async _ => {
return Buffer.from('test')
})
@@ -161,7 +160,7 @@ describe('publishOCIArtifact', () => {
})
// Simulate successful reading of all the files
fsReadFileSyncMock.mockImplementation(async path => {
fsReadFileSyncMock.mockImplementation(async _ => {
return Buffer.from('test')
})
+10
View File
@@ -12,6 +12,7 @@
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0",
"@types/axios": "^0.14.0",
"archiver": "^6.0.1",
"axios": "^1.6.2",
"axios-debug-log": "^1.0.0",
@@ -1518,6 +1519,15 @@
"@types/readdir-glob": "*"
}
},
"node_modules/@types/axios": {
"version": "0.14.0",
"resolved": "https://registry.npmjs.org/@types/axios/-/axios-0.14.0.tgz",
"integrity": "sha512-KqQnQbdYE54D7oa/UmYVMZKq7CO4l8DEENzOKc4aBRwxCXSlJXGz83flFx5L7AWrOQnmuN3kVsRdt+GZPPjiVQ==",
"deprecated": "This is a stub types definition for axios (https://github.com/mzabriskie/axios). axios provides its own type definitions, so you don't need @types/axios installed!",
"dependencies": {
"axios": "*"
}
},
"node_modules/@types/babel__core": {
"version": "7.20.1",
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz",
+1
View File
@@ -69,6 +69,7 @@
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0",
"@types/axios": "^0.14.0",
"archiver": "^6.0.1",
"axios": "^1.6.2",
"axios-debug-log": "^1.0.0",