mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 07:08:02 +00:00
feat(front): add Vitest configuration and unit tests for calcFileHash to ensure consistency between native and wasm engines
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import calcFileHash from './calcFileHash'
|
||||
import calcFileHash from '@/lib/calcFileHash'
|
||||
|
||||
const makeFile = (content: string) => new File([content], 'test.txt', { type: 'text/plain' })
|
||||
|
||||
15
front/vitest.config.ts
Normal file
15
front/vitest.config.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
import { defineConfig } from 'vitest/config'
|
||||
|
||||
const rootDir = fileURLToPath(new URL('./', import.meta.url))
|
||||
|
||||
export default defineConfig({
|
||||
resolve: {
|
||||
alias: [
|
||||
{ find: /^@\/(.*)$/, replacement: `${rootDir}$1` },
|
||||
{ find: /^~\/(.*)$/, replacement: `${rootDir}$1` },
|
||||
{ find: /^@@\/(.*)$/, replacement: `${rootDir}$1` },
|
||||
{ find: /^~~\/(.*)$/, replacement: `${rootDir}$1` },
|
||||
],
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user