File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66import { vi } from "vitest" ;
77
8- const DavCollection = vi . fn ( )
9-
10- DavCollection . prototype . findAll = vi . fn ( ) ;
11- DavCollection . prototype . findAllByFilter = vi . fn ( ) ;
12- DavCollection . prototype . find = vi . fn ( ) ;
13- DavCollection . prototype . createCollection = vi . fn ( ) ;
14- DavCollection . prototype . createObject = vi . fn ( ) ;
15- DavCollection . prototype . update = vi . fn ( ) ;
16- DavCollection . prototype . delete = vi . fn ( ) ;
17- DavCollection . prototype . isReadable = vi . fn ( ) ;
18- DavCollection . prototype . isWriteable = vi . fn ( ) ;
19- DavCollection . prototype . isSameCollectionTypeAs = vi . fn ( ) ;
8+ const DavCollection = vi . fn ( ) . mockImplementation ( function ( ) {
9+ this . findAll = vi . fn ( ) ;
10+ this . findAllByFilter = vi . fn ( ) ;
11+ this . find = vi . fn ( ) ;
12+ this . createCollection = vi . fn ( ) ;
13+ this . createObject = vi . fn ( ) ;
14+ this . update = vi . fn ( ) ;
15+ this . delete = vi . fn ( ) ;
16+ this . isReadable = vi . fn ( ) ;
17+ this . isWriteable = vi . fn ( ) ;
18+ this . isSameCollectionTypeAs = vi . fn ( ) ;
19+ } ) ;
2020
2121export { DavCollection } ;
Original file line number Diff line number Diff line change 55
66import { vi } from "vitest" ;
77
8- const Request = vi . fn ( )
9-
10- Request . prototype . propFind = vi . fn ( ) ;
11- Request . prototype . put = vi . fn ( ) ;
12- Request . prototype . post = vi . fn ( ) ;
13- Request . prototype . delete = vi . fn ( ) ;
14- Request . prototype . move = vi . fn ( ) ;
15- Request . prototype . copy = vi . fn ( ) ;
16- Request . prototype . report = vi . fn ( ) ;
17- Request . prototype . pathname = vi . fn ( ) ;
18- Request . prototype . propPatch = vi . fn ( ) ;
19- Request . prototype . mkCol = vi . fn ( ) ;
8+ const Request = vi . fn ( ) . mockImplementation ( function ( ) {
9+ this . propFind = vi . fn ( ) ;
10+ this . put = vi . fn ( ) ;
11+ this . post = vi . fn ( ) ;
12+ this . delete = vi . fn ( ) ;
13+ this . move = vi . fn ( ) ;
14+ this . copy = vi . fn ( ) ;
15+ this . report = vi . fn ( ) ;
16+ this . pathname = vi . fn ( ) ;
17+ this . propPatch = vi . fn ( ) ;
18+ this . mkCol = vi . fn ( ) ;
19+ } ) ;
2020
2121export default Request
You can’t perform that action at this time.
0 commit comments