Agent Police Department v1.0.0 MVP

This commit is contained in:
BunBun Builder
2026-06-14 13:18:56 +00:00
commit 672e9ef17c
30 changed files with 7619 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
// __mocks__/chrome.js — Mock Chrome APIs for Node.js testing
global.chrome = {
storage: {
local: {
get: jest.fn(async (keys) => {
const store = {};
if (typeof keys === 'string') keys = [keys];
for (const key of keys) {
store[key] = global.__chromeStore?.[key] ?? null;
}
return store;
}),
set: jest.fn(async (items) => {
global.__chromeStore = { ...global.__chromeStore, ...items };
}),
remove: jest.fn(async (keys) => {
if (typeof keys === 'string') keys = [keys];
for (const key of keys) delete global.__chromeStore?.[key];
}),
clear: jest.fn(async () => {
global.__chromeStore = {};
})
}
},
runtime: {
getManifest: jest.fn(() => ({ version: '1.0.0' }))
},
action: {
setBadgeText: jest.fn(async () => {}),
setBadgeBackgroundColor: jest.fn(async () => {})
}
};
global.__chromeStore = {};