4
0
Fork 0
mirror of https://github.com/Azure/setup-helm.git synced 2025-11-07 13:06:56 +00:00

Fix types, and update node version.

Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>
This commit is contained in:
Tatsat Mishra 2025-05-13 21:58:04 +12:00
parent 05502a08f2
commit fc282b5411
No known key found for this signature in database
GPG key ID: 314561C38E2C59F4
3 changed files with 24 additions and 24 deletions

8
package-lock.json generated
View file

@ -18,7 +18,7 @@
},
"devDependencies": {
"@types/jest": "^29.5.14",
"@types/node": "^22.15.3",
"@types/node": "^22.15.17",
"@vercel/ncc": "^0.38.3",
"jest": "^29.7.0",
"prettier": "^3.5.3",
@ -1365,9 +1365,9 @@
}
},
"node_modules/@types/node": {
"version": "22.15.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.3.tgz",
"integrity": "sha512-lX7HFZeHf4QG/J7tBZqrCAXwz9J5RD56Y6MpP0eJkka8p+K0RY/yBTW7CYFJ4VGCclxqOLKmiGP5juQc6MKgcw==",
"version": "22.15.17",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.17.tgz",
"integrity": "sha512-wIX2aSZL5FE+MR0JlvF87BNVrtFWf6AE6rxSE9X7OwnVvoyCQjpzSRJ+M87se/4QCkCiebQAqrJ0y6fwIyi7nw==",
"dev": true,
"license": "MIT",
"dependencies": {

View file

@ -24,7 +24,7 @@
},
"devDependencies": {
"@types/jest": "^29.5.14",
"@types/node": "^22.15.3",
"@types/node": "^22.15.17",
"@vercel/ncc": "^0.38.3",
"jest": "^29.7.0",
"prettier": "^3.5.3",

View file

@ -99,20 +99,20 @@ describe('run.ts', () => {
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => {
if (file == 'mainFolder')
return [
'file1' as unknown as fs.Dirent,
'file2' as unknown as fs.Dirent,
'folder1' as unknown as fs.Dirent,
'folder2' as unknown as fs.Dirent
'file1' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'file2' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'folder1' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'folder2' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
]
if (file == path.join('mainFolder', 'folder1'))
return [
'file11' as unknown as fs.Dirent,
'file12' as unknown as fs.Dirent
'file11' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'file12' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
]
if (file == path.join('mainFolder', 'folder2'))
return [
'file21' as unknown as fs.Dirent,
'file22' as unknown as fs.Dirent
'file21' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'file22' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
]
return []
})
@ -134,20 +134,20 @@ describe('run.ts', () => {
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => {
if (file == 'mainFolder')
return [
'file1' as unknown as fs.Dirent,
'file2' as unknown as fs.Dirent,
'folder1' as unknown as fs.Dirent,
'folder2' as unknown as fs.Dirent
'file1' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'file2' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'folder1' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'folder2' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
]
if (file == path.join('mainFolder', 'folder1'))
return [
'file11' as unknown as fs.Dirent,
'file12' as unknown as fs.Dirent
'file11' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'file12' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
]
if (file == path.join('mainFolder', 'folder2'))
return [
'file21' as unknown as fs.Dirent,
'file22' as unknown as fs.Dirent
'file21' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'file22' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
]
return []
})
@ -166,7 +166,7 @@ describe('run.ts', () => {
test('findHelm() - change access permissions and find the helm in given directory', () => {
jest.spyOn(fs, 'chmodSync').mockImplementation(() => {})
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => {
if (file == 'mainFolder') return ['helm.exe' as unknown as fs.Dirent]
if (file == 'mainFolder') return ['helm.exe' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>]
return []
})
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
@ -208,7 +208,7 @@ describe('run.ts', () => {
jest.spyOn(toolCache, 'cacheDir').mockResolvedValue('pathToCachedDir')
jest
.spyOn(fs, 'readdirSync')
.mockImplementation((file, _) => ['helm.exe' as unknown as fs.Dirent])
.mockImplementation((file, _) => ['helm.exe' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>])
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
const isDirectory =
(file as string).indexOf('folder') == -1 ? false : true
@ -254,7 +254,7 @@ describe('run.ts', () => {
jest.spyOn(fs, 'chmodSync').mockImplementation(() => {})
jest
.spyOn(fs, 'readdirSync')
.mockReturnValue(['helm.exe' as unknown as fs.Dirent])
.mockReturnValue(['helm.exe' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>])
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
const isDirectory =
(file as string).indexOf('folder') == -1 ? false : true