Skip to content

Commit ff804f9

Browse files
authored
fix: mock embeddings module to prevent onnxruntime-web worker error in tests (#20)
Github Action failure: https://github.com/reddit/devvit-mcp/actions/runs/19406523269/job/55521967266 The @xenova/transformers library uses onnxruntime-web which attempts to create web workers using blob URLs. This fails in Node.js test environments with the error: 'The worker script or module filename must be an absolute path or a relative path starting with './' or '../'. Received blob:...' By mocking the embeddings module in DocumentManagementService.test.ts, we prevent the transformers pipeline from initializing during tests, avoiding the worker script error while maintaining test coverage.
1 parent f5ce0f9 commit ff804f9

2 files changed

Lines changed: 1107 additions & 991 deletions

File tree

0 commit comments

Comments
 (0)