Skip to content

Commit

Permalink
fix(tests): Adjust tests for updated webdav library
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed May 31, 2024
1 parent a4eb5d4 commit b5d87a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/files/src/services/Files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { File, Folder, davParsePermissions, davGetDefaultPropfind } from '@nextc
import { generateRemoteUrl } from '@nextcloud/router'
import { getCurrentUser } from '@nextcloud/auth'

import { getClient, rootPath } from './WebdavClient'
import { getClient, rootPath } from './WebdavClient.ts'
import { hashCode } from '../utils/hashUtils'
import logger from '../logger'

Expand Down
6 changes: 3 additions & 3 deletions apps/files/src/services/WebdavClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
import type { RequestOptions, Response } from 'webdav'
import type { RequestOptions, Response, WebDAVClientContext } from 'webdav'

import { createClient, getPatcher } from 'webdav'
import { generateRemoteUrl } from '@nextcloud/router'
Expand All @@ -45,12 +45,12 @@ export const getClient = (rootUrl = defaultRootUrl) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// https://github.com/perry-mitchell/hot-patcher/issues/6
patcher.patch('request', (options: RequestOptions): Promise<Response> => {
patcher.patch('request', (options: RequestOptions, context: WebDAVClientContext): Promise<Response> => {
if (options.headers?.method) {
options.method = options.headers.method
delete options.headers.method
}
return request(options)
return request(options, context)
})
return client
}
1 change: 1 addition & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const ignorePatterns = [
'char-regex',
'hot-patcher',
'is-svg',
'layerr',
'mime',
'p-cancelable',
'p-limit',
Expand Down

0 comments on commit b5d87a7

Please sign in to comment.