Skip to content

Commit 23b93c2

Browse files
committed
test: mock axios and cdav-library
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
1 parent 52473d8 commit 23b93c2

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tests/setup.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@ jest.mock('@nextcloud/initial-state', () => ({
1212
loadState: (app, key, fallback) => fallback,
1313
}))
1414

15+
jest.mock('@nextcloud/cdav-library', () => ({
16+
__esModule: true,
17+
default: jest.fn(),
18+
namespaces: {},
19+
}))
20+
21+
jest.mock('@nextcloud/axios', () => ({
22+
__esModule: true,
23+
default: {
24+
get: jest.fn(),
25+
post: jest.fn(),
26+
put: jest.fn(),
27+
patch: jest.fn(),
28+
delete: jest.fn(),
29+
},
30+
}), { virtual: true })
31+
1532
global.appName = 'contacts'
1633

1734
global.OC = {

0 commit comments

Comments
 (0)