mirror of
https://github.com/Azure/setup-helm.git
synced 2025-11-07 13:06:56 +00:00
Merge e6514c5aab into 0400c1212d
This commit is contained in:
commit
36bebcc5ff
1 changed files with 19 additions and 21 deletions
|
|
@ -108,20 +108,20 @@ describe('run.ts', () => {
|
||||||
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => {
|
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => {
|
||||||
if (file == 'mainFolder')
|
if (file == 'mainFolder')
|
||||||
return [
|
return [
|
||||||
'file1' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
|
'file1' as unknown as fs.Dirent<NonSharedBuffer>,
|
||||||
'file2' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
|
'file2' as unknown as fs.Dirent<NonSharedBuffer>,
|
||||||
'folder1' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
|
'folder1' as unknown as fs.Dirent<NonSharedBuffer>,
|
||||||
'folder2' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
|
'folder2' as unknown as fs.Dirent<NonSharedBuffer>
|
||||||
]
|
]
|
||||||
if (file == path.join('mainFolder', 'folder1'))
|
if (file == path.join('mainFolder', 'folder1'))
|
||||||
return [
|
return [
|
||||||
'file11' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
|
'file11' as unknown as fs.Dirent<NonSharedBuffer>,
|
||||||
'file12' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
|
'file12' as unknown as fs.Dirent<NonSharedBuffer>
|
||||||
]
|
]
|
||||||
if (file == path.join('mainFolder', 'folder2'))
|
if (file == path.join('mainFolder', 'folder2'))
|
||||||
return [
|
return [
|
||||||
'file21' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
|
'file21' as unknown as fs.Dirent<NonSharedBuffer>,
|
||||||
'file22' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
|
'file22' as unknown as fs.Dirent<NonSharedBuffer>
|
||||||
]
|
]
|
||||||
return []
|
return []
|
||||||
})
|
})
|
||||||
|
|
@ -143,20 +143,20 @@ describe('run.ts', () => {
|
||||||
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => {
|
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => {
|
||||||
if (file == 'mainFolder')
|
if (file == 'mainFolder')
|
||||||
return [
|
return [
|
||||||
'file1' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
|
'file1' as unknown as fs.Dirent<NonSharedBuffer>,
|
||||||
'file2' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
|
'file2' as unknown as fs.Dirent<NonSharedBuffer>,
|
||||||
'folder1' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
|
'folder1' as unknown as fs.Dirent<NonSharedBuffer>,
|
||||||
'folder2' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
|
'folder2' as unknown as fs.Dirent<NonSharedBuffer>
|
||||||
]
|
]
|
||||||
if (file == path.join('mainFolder', 'folder1'))
|
if (file == path.join('mainFolder', 'folder1'))
|
||||||
return [
|
return [
|
||||||
'file11' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
|
'file11' as unknown as fs.Dirent<NonSharedBuffer>,
|
||||||
'file12' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
|
'file12' as unknown as fs.Dirent<NonSharedBuffer>
|
||||||
]
|
]
|
||||||
if (file == path.join('mainFolder', 'folder2'))
|
if (file == path.join('mainFolder', 'folder2'))
|
||||||
return [
|
return [
|
||||||
'file21' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
|
'file21' as unknown as fs.Dirent<NonSharedBuffer>,
|
||||||
'file22' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
|
'file22' as unknown as fs.Dirent<NonSharedBuffer>
|
||||||
]
|
]
|
||||||
return []
|
return []
|
||||||
})
|
})
|
||||||
|
|
@ -176,7 +176,7 @@ describe('run.ts', () => {
|
||||||
jest.spyOn(fs, 'chmodSync').mockImplementation(() => {})
|
jest.spyOn(fs, 'chmodSync').mockImplementation(() => {})
|
||||||
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => {
|
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => {
|
||||||
if (file == 'mainFolder')
|
if (file == 'mainFolder')
|
||||||
return ['helm.exe' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>]
|
return ['helm.exe' as unknown as fs.Dirent<NonSharedBuffer>]
|
||||||
return []
|
return []
|
||||||
})
|
})
|
||||||
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
|
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
|
||||||
|
|
@ -220,7 +220,7 @@ describe('run.ts', () => {
|
||||||
jest
|
jest
|
||||||
.spyOn(fs, 'readdirSync')
|
.spyOn(fs, 'readdirSync')
|
||||||
.mockImplementation((file, _) => [
|
.mockImplementation((file, _) => [
|
||||||
'helm.exe' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
|
'helm.exe' as unknown as fs.Dirent<NonSharedBuffer>
|
||||||
])
|
])
|
||||||
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
|
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
|
||||||
const isDirectory =
|
const isDirectory =
|
||||||
|
|
@ -269,9 +269,7 @@ describe('run.ts', () => {
|
||||||
jest.spyOn(fs, 'chmodSync').mockImplementation(() => {})
|
jest.spyOn(fs, 'chmodSync').mockImplementation(() => {})
|
||||||
jest
|
jest
|
||||||
.spyOn(fs, 'readdirSync')
|
.spyOn(fs, 'readdirSync')
|
||||||
.mockReturnValue([
|
.mockReturnValue(['helm.exe' as unknown as fs.Dirent<NonSharedBuffer>])
|
||||||
'helm.exe' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
|
|
||||||
])
|
|
||||||
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
|
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
|
||||||
const isDirectory =
|
const isDirectory =
|
||||||
(file as string).indexOf('folder') == -1 ? false : true
|
(file as string).indexOf('folder') == -1 ? false : true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue