-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.setup.js
56 lines (54 loc) · 928 Bytes
/
jest.setup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Mock console.error for testing
global.console.error = jest.fn();
// Mock chrome API
global.chrome = {
storage: {
sync: {
get: jest.fn(),
set: jest.fn(),
},
local: {
get: jest.fn(),
set: jest.fn(),
},
},
tabs: {
query: jest.fn(),
group: jest.fn(),
onUpdated: {
addListener: jest.fn(),
},
onRemoved: {
addListener: jest.fn(),
},
},
tabGroups: {
update: jest.fn(),
},
alarms: {
clear: jest.fn(),
create: jest.fn(),
onAlarm: {
addListener: jest.fn(),
},
},
runtime: {
onMessage: {
addListener: jest.fn(),
},
onInstalled: {
addListener: jest.fn(),
},
getURL: jest.fn(),
},
};
// Mock settings
global.settings = {
similarityThreshold: 0.3,
groupingInterval: 5,
maxGroupNameLength: 15,
groupingAlgorithm: 'tfidf',
bm25k1: 1.5,
bm25b: 0.75,
lsaDimensions: 50,
};