-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathvitest.config.js
More file actions
33 lines (29 loc) · 867 Bytes
/
vitest.config.js
File metadata and controls
33 lines (29 loc) · 867 Bytes
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
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { defineConfig } from 'vitest/config'
import { execSync } from 'child_process'
process.env.REDISMS_DISABLE_POSTINSTALL = '0'
let redisMemoryServerAvailable = false
try {
console.log('Rebuilding redis-memory-server...')
execSync('npm rebuild redis-memory-server', { stdio: 'inherit' })
redisMemoryServerAvailable = true
} catch (e) {
console.error('Failed to rebuild redis-memory-server:', e?.message ?? e)
console.warn('⚠️ Skipping Redis-dependent tests (multinode-redis.spec.mjs)')
}
export default defineConfig({
test: {
environment: 'node',
include: [
'tests/integration/*.spec.?(c|m)[jt]s?(x)',
],
exclude: redisMemoryServerAvailable
? []
: [
'**/multinode-redis.spec.mjs',
],
},
})