mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
refactor: replace Jest with bun
This commit is contained in:
1 parent
634dc8f987
commit
54225528b3
21 files changed
+66
-856
No files matched your search
@@ -1,28 +1,7 @@
|
||||
import { test, expect } from '@jest/globals'
|
||||
import { IFileExistenceChecker, IFileInput } from '../schema'
|
||||
import { test, expect } from 'bun:test'
|
||||
import { checkFiles } from '../condition/FileMatcher.js'
|
||||
import { Condition } from '../condition/Condition.js'
|
||||
|
||||
export class MockFileChecker implements IFileExistenceChecker {
|
||||
private files: IFileInput[] = [
|
||||
{
|
||||
path: '/home/user/hello.txt',
|
||||
type: 'file',
|
||||
},
|
||||
{
|
||||
path: '/home/user/world.txt',
|
||||
type: 'file',
|
||||
},
|
||||
{
|
||||
path: '/home/user/Downloads',
|
||||
type: 'directory',
|
||||
},
|
||||
]
|
||||
|
||||
async exists(file: IFileInput): Promise<boolean> {
|
||||
return this.files.some((f) => f.path === file.path && f.type === file.type)
|
||||
}
|
||||
}
|
||||
import { MockFileChecker } from './mockFileChecker'
|
||||
|
||||
test('file matcher', async () => {
|
||||
const checker = new MockFileChecker()
|
||||
|
||||
Reference in new issue
Block a user