Warn excluded hidden files

This commit is contained in:
Mai Nakagawa 2025-05-02 10:21:38 +09:00
parent 6027e3dd17
commit ac7ab52308
No known key found for this signature in database
GPG key ID: 2E1718EE2515B140
2 changed files with 28 additions and 1 deletions

View file

@ -386,6 +386,7 @@ describe('Search', () => {
})
it('Hidden files ignored by default', async () => {
const warningSpy = jest.spyOn(core, 'warning')
const searchPath = path.join(root, '**/*')
const searchResult = await findFilesToUpload(searchPath)
@ -394,14 +395,19 @@ describe('Search', () => {
expect(searchResult.filesToUpload).not.toContain(
fileInHiddenFolderInFolderA
)
expect(warningSpy).toHaveBeenCalledWith(
expect.stringMatching(/Set include-hidden-files to true to include these files.$/)
)
})
it('Hidden files included', async () => {
const warningSpy = jest.spyOn(core, 'warning')
const searchPath = path.join(root, '**/*')
const searchResult = await findFilesToUpload(searchPath, true)
expect(searchResult.filesToUpload).toContain(hiddenFile)
expect(searchResult.filesToUpload).toContain(fileInHiddenFolderPath)
expect(searchResult.filesToUpload).toContain(fileInHiddenFolderInFolderA)
expect(warningSpy).not.toHaveBeenCalled()
})
})