mirror of
https://github.com/actions/upload-artifact.git
synced 2026-02-26 21:52:30 +00:00
Fix linting issues
This commit is contained in:
@ -1,3 +0,0 @@
|
|||||||
node_modules/
|
|
||||||
lib/
|
|
||||||
dist/
|
|
||||||
@ -42,15 +42,15 @@ jest.unstable_mockModule('@actions/core', () => ({
|
|||||||
const actualFsPromises = await import('fs/promises')
|
const actualFsPromises = await import('fs/promises')
|
||||||
jest.unstable_mockModule('fs/promises', () => ({
|
jest.unstable_mockModule('fs/promises', () => ({
|
||||||
...actualFsPromises,
|
...actualFsPromises,
|
||||||
mkdtemp:
|
mkdtemp: jest
|
||||||
jest.fn<() => Promise<string>>().mockResolvedValue('/tmp/merge-artifact'),
|
.fn<() => Promise<string>>()
|
||||||
|
.mockResolvedValue('/tmp/merge-artifact'),
|
||||||
rm: jest.fn<() => Promise<void>>().mockResolvedValue(undefined)
|
rm: jest.fn<() => Promise<void>>().mockResolvedValue(undefined)
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// Mock shared search module
|
// Mock shared search module
|
||||||
const mockFindFilesToUpload = jest.fn<
|
const mockFindFilesToUpload =
|
||||||
() => Promise<{filesToUpload: string[]; rootDirectory: string}>
|
jest.fn<() => Promise<{filesToUpload: string[]; rootDirectory: string}>>()
|
||||||
>()
|
|
||||||
jest.unstable_mockModule('../src/shared/search.js', () => ({
|
jest.unstable_mockModule('../src/shared/search.js', () => ({
|
||||||
findFilesToUpload: mockFindFilesToUpload
|
findFilesToUpload: mockFindFilesToUpload
|
||||||
}))
|
}))
|
||||||
|
|||||||
@ -315,7 +315,7 @@ describe('Search', () => {
|
|||||||
const searchPath1 = path.join(root, 'folder-a')
|
const searchPath1 = path.join(root, 'folder-a')
|
||||||
const searchPath2 = path.join(root, 'folder-d')
|
const searchPath2 = path.join(root, 'folder-d')
|
||||||
|
|
||||||
const searchPaths = searchPath1 + '\n' + searchPath2
|
const searchPaths = `${searchPath1}\n${searchPath2}`
|
||||||
const searchResult = await findFilesToUpload(searchPaths)
|
const searchResult = await findFilesToUpload(searchPaths)
|
||||||
|
|
||||||
expect(searchResult.rootDirectory).toEqual(root)
|
expect(searchResult.rootDirectory).toEqual(root)
|
||||||
@ -341,7 +341,7 @@ describe('Search', () => {
|
|||||||
const searchPath3 = path.join(root, 'folder-a', 'folder-b', '**/extra*.txt')
|
const searchPath3 = path.join(root, 'folder-a', 'folder-b', '**/extra*.txt')
|
||||||
|
|
||||||
// negating the third search path
|
// negating the third search path
|
||||||
const searchPaths = searchPath1 + '\n' + searchPath2 + '\n!' + searchPath3
|
const searchPaths = `${searchPath1}\n${searchPath2}\n!${searchPath3}`
|
||||||
const searchResult = await findFilesToUpload(searchPaths)
|
const searchResult = await findFilesToUpload(searchPaths)
|
||||||
|
|
||||||
expect(searchResult.rootDirectory).toEqual(root)
|
expect(searchResult.rootDirectory).toEqual(root)
|
||||||
|
|||||||
@ -39,9 +39,8 @@ jest.unstable_mockModule('@actions/core', () => ({
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
// Mock shared search module
|
// Mock shared search module
|
||||||
const mockFindFilesToUpload = jest.fn<
|
const mockFindFilesToUpload =
|
||||||
() => Promise<{filesToUpload: string[]; rootDirectory: string}>
|
jest.fn<() => Promise<{filesToUpload: string[]; rootDirectory: string}>>()
|
||||||
>()
|
|
||||||
jest.unstable_mockModule('../src/shared/search.js', () => ({
|
jest.unstable_mockModule('../src/shared/search.js', () => ({
|
||||||
findFilesToUpload: mockFindFilesToUpload
|
findFilesToUpload: mockFindFilesToUpload
|
||||||
}))
|
}))
|
||||||
|
|||||||
Reference in New Issue
Block a user