mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-26 02:04:37 +08:00
test(ai): use supported module mock exports
Use Node's namedExports option so the optional Jieba regression test remains valid under the current node:test type definitions.
This commit is contained in:
1 parent
9378029acb
commit
f35e41ca70
1 file changed
+1
-1
@@ -5,7 +5,7 @@ import type { AIMemoryEntry } from '@openchatlab/shared-types'
|
||||
test('ranks Chinese memories without loading the optional Jieba segmenter', async (t) => {
|
||||
let segmentCalls = 0
|
||||
await t.mock.module('../../nlp/segmenter', {
|
||||
exports: {
|
||||
namedExports: {
|
||||
segment() {
|
||||
segmentCalls++
|
||||
throw new Error('optional Jieba dependency is unavailable')
|
||||
|
||||
Reference in new issue
Block a user