-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathvitest.config.ts
More file actions
68 lines (66 loc) · 1.63 KB
/
Copy pathvitest.config.ts
File metadata and controls
68 lines (66 loc) · 1.63 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
/**
* SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: CC0-1.0
*/
import { playwright } from '@vitest/browser-playwright'
import { resolve } from 'node:path'
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
env: {
LANG: 'en-US',
},
browser: {
enabled: true,
headless: true,
provider: playwright(),
instances: [
{
name: 'unit',
browser: 'chromium',
screenshotFailures: false,
exclude: ['**/*.e2e.spec.ts', '**/node_modules/**', '**/.git/**'],
},
{
name: 'integration',
browser: 'chromium',
screenshotFailures: false,
include: ['**/*.e2e.spec.ts'],
globalSetup: '__tests__/start-nextcloud-server.js',
},
],
},
coverage: {
include: ['lib/**'],
exclude: ['lib/utils/logger.ts'],
provider: 'istanbul',
reporter: ['lcov', 'text'],
},
globalSetup: '__tests__/test-global-setup.ts',
},
resolve: {
alias: {
'~': resolve(__dirname, 'lib'),
},
},
server: {
proxy: {
'/nextcloud': {
target: 'http://localhost:8089',
changeOrigin: true,
configure(proxy) {
// rewrite destination header to remove /nextcloud prefix, otherwise the MOVE request will fail
proxy.on('proxyReq', (proxyReq) => {
const header = proxyReq.getHeader('Destination')
if (header) {
proxyReq.removeHeader('Destination')
proxyReq.setHeader('Destination', header.toString().replace(/\/nextcloud\/remote\.php/, '/remote.php'))
}
})
},
rewrite: (path) => path.replace(/^\/nextcloud/, ''),
auth: 'admin:admin',
},
},
},
})