Skip to content

Commit

Permalink
fix: tests for CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
ndragun92 committed Mar 11, 2024
1 parent 9a824d5 commit 024fa39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "file-sys-cache",
"version": "1.0.0",
"version": "1.0.1",
"description": "A Node.js package providing efficient caching using the file system for storage.",
"type": "module",
"main": "./dist/file-sys-cache.cjs",
Expand Down
12 changes: 7 additions & 5 deletions src/lib/file-sys-cache.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,14 @@ describe('FileSysCache', () => {

expect(result).toContain(fileName)
})
it('should throw an error if folder path is wrong', async () => {
console.error = jest.fn()
const cache = new FileSysCache({ basePath: '?', debug: true })
if (process.env.NODE_ENV === 'test') {
it('should throw an error if folder path is wrong', async () => {
console.error = jest.fn()
const cache = new FileSysCache({ basePath: '?', debug: true })

await expect(cache.set({ fileName, key, payload })).rejects.toThrow('no such file or directory')
})
await expect(cache.set({ fileName, key, payload })).rejects.toThrow('no such file or directory')
})
}
})

describe('get', () => {
Expand Down

0 comments on commit 024fa39

Please sign in to comment.