mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
test: Add mock for kontroll module
- Add CommonJS mock implementation of kontroll's countdown function - Add kontroll to moduleNameMapper in Jest config - Resolves 'Cannot find module kontroll' test errors
This commit is contained in:
parent
34457ee0f3
commit
87236c7ea0
2 changed files with 10 additions and 1 deletions
8
src/__mocks__/kontroll.js
Normal file
8
src/__mocks__/kontroll.js
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// Mock implementation of kontroll's countdown function
|
||||
module.exports = {
|
||||
countdown: (delay, callback, options = {}) => {
|
||||
// Simple mock that just calls the callback immediately
|
||||
setTimeout(callback, 0)
|
||||
return () => {} // Return a no-op cleanup function
|
||||
},
|
||||
}
|
||||
|
|
@ -37,9 +37,10 @@ export default {
|
|||
"^default-shell$": "<rootDir>/__mocks__/default-shell.js",
|
||||
"^os-name$": "<rootDir>/__mocks__/os-name.js",
|
||||
"^strip-bom$": "<rootDir>/__mocks__/strip-bom.js",
|
||||
"^kontroll$": "<rootDir>/__mocks__/kontroll.js",
|
||||
},
|
||||
transformIgnorePatterns: [
|
||||
"node_modules/(?!(@modelcontextprotocol|delay|p-wait-for|serialize-error|strip-ansi|default-shell|os-name|strip-bom)/)",
|
||||
"node_modules/(?!(@modelcontextprotocol|delay|p-wait-for|serialize-error|strip-ansi|default-shell|os-name|strip-bom|kontroll)/)",
|
||||
],
|
||||
roots: ["<rootDir>"],
|
||||
modulePathIgnorePatterns: ["dist", "out"],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue