mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-07 19:10:12 +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
@@ -9,8 +9,5 @@
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"dev": "tsc -w"
|
||||
},
|
||||
"dependencies": {
|
||||
"@linux-odyssey/models": "workspace:^"
|
||||
}
|
||||
}
|
||||
@@ -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)]
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { isValidEmail, isValidUsername } from '../src/auth'
|
||||
import { isValidEmail, isValidUsername } from '../src/auth.js'
|
||||
|
||||
test('check valid username', () => {
|
||||
const valid = ['alex', 'alex123', 'john_doe', 'john-doe', 'rudeus']
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { buildFileCheckCmd, File } from '../src/commands'
|
||||
import { buildFileCheckCmd, File } from '../src/commands.js'
|
||||
|
||||
describe('buildFileCheckCmd function', () => {
|
||||
it('builds the file check command correctly', () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import DAG from '../src/dag'
|
||||
import DAG from '../src/dag.js'
|
||||
|
||||
describe('dag layers', () => {
|
||||
it('two layer', () => {
|
||||
|
||||
Reference in new issue
Block a user