mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 11:30:13 +08:00
fix: jest. enable coverage
This commit is contained in:
1 parent
37b1bead28
commit
c0efce69f4
12 files changed
+281
-70
No files matched your search
@@ -1,4 +1,7 @@
|
||||
import type { IFileCondition } from '@linux-odyssey/models'
|
||||
export interface File {
|
||||
path: string
|
||||
type: string
|
||||
}
|
||||
|
||||
const fileTypes = new Map([
|
||||
['file', '-f'],
|
||||
@@ -11,7 +14,7 @@ function sanitizePath(path: string): string {
|
||||
return path.replace(/[^a-zA-Z0-9._/-]/g, '')
|
||||
}
|
||||
|
||||
export function buildFileCheckCmd(file: IFileCondition): string[] {
|
||||
export function buildFileCheckCmd(file: File): string[] {
|
||||
const { path, type } = file
|
||||
return ['test', fileTypes.get(type) || '-e', sanitizePath(path)]
|
||||
}
|
||||
Reference in new issue
Block a user