forked from stelace/stelace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathava.config.cjs
34 lines (26 loc) · 992 Bytes
/
ava.config.cjs
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
require('dotenv').config()
const { IGNORED_LOCAL_PLUGINS, TESTS, STELACE_PLUGINS_PATHS, INSTANT_DATA } = process.env
const fromEnvVar = (v = '') => v.split(',').filter(Boolean).map(s => s.trim())
const pluginTestsToIgnore = fromEnvVar(IGNORED_LOCAL_PLUGINS).map(p => `!plugins/${p}/**/*`)
const cliLoadedPluginTests = fromEnvVar(STELACE_PLUGINS_PATHS).map(p => `${p}/**/*.spec.js`)
let tests = []
const seedTests = ['scripts/instantData.js']
const integrationTests = ['test/integration/**/*.spec.js', 'plugins/**/*.spec.js', ...cliLoadedPluginTests]
const unitTests = ['test/unit/**/*.spec.js']
let files = []
if (INSTANT_DATA === 'true') files = [...seedTests]
else {
if (TESTS === 'integration') tests.push(...integrationTests)
else if (TESTS === 'unit') tests.push(...unitTests)
else tests = [...unitTests, ...integrationTests]
files = [
...tests,
...pluginTestsToIgnore
]
}
module.exports = () => ({
files,
serial: false,
cache: false,
timeout: '30s'
})