-
Notifications
You must be signed in to change notification settings - Fork 2
/
suman.conf.js
executable file
·147 lines (121 loc) · 5.39 KB
/
suman.conf.js
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
// => The Suman config file, should always remain at the root of your project
// => For more info, see => oresoftware.github.io/suman/conf.html
// => If transpile is true, Suman will put your babel deps in ~/.suman/node_modules
const os = require('os');
const path = require('path');
const numOfCPUs = os.cpus().length || 1;
////////////////////////////////////////////////
module.exports = Object.freeze({
// Array<regex>
matchAny: [], //recommended regex for "matchAny" => [/\.test\.js$/],
matchNone: [/fixture/, /.*target/], //recommended regex for "matchNone" => [/fixture/],
matchAll: [/\.test\.js$/], //recommended regex for "matchAll" => [],
// Object: child process logging
childProcessLogs: [0,1,2],
//string
testDir: 'test',
testSrcDir: 'test/src', // recommended that you create a test/src directory
testTargetDir: 'test/target', // only used if compiling/transpiling tests
sumanHelpersDir: 'test/_suman',
uniqueAppName: '<your-app-name-here>',
browser: 'Firefox', // browser to open test results with
//boolean
useTAPOutput: false,
errorsOnly: false,
replayErrorsAtRunnerEnd: true,
logStdoutToTestLogs: false, // by default only stderr is logged to test log files
allowArrowFunctionsForTestBlocks: false,
alwaysUseRunner: false, //always run your individual tests in child process
enforceGlobalInstallationOnly: false,
enforceLocalInstallationOnly: false,
sourceTopLevelDepsInPackageDotJSON: false,
enforceTestCaseNames: true,
enforceBlockNames: true,
enforceHookNames: false,
bail: true, // when running one file, bail will bail test at first test failure
bailRunner: true, // when using the runner, bail will bail runner at first test failure in any file
useBabelRegister: false,
transpile: false, // transpile is false by default, can be overridden with command line also
executeRunnerCWDAtTestFile: true, // if false, CWD for runner will be project root dir
sendStderrToSumanErrLogOnly: true,
useSuiteNameInTestCaseOutput: false,
ultraSafe: false, //if true, Suman reads files before executing any supposed test file and makes sure it's a suman test before running
verbose: true, //handles and logs warnings (using warning level?)
checkMemoryUsage: false, //limits stack traces to just relevant test case or test line
fullStackTraces: false, //allows you to view more than 3 lines for errors in test cases and hooks
disableAutoOpen: false, // use true if you never want suman to automatically open the browser to the latest test results
suppressRunnerOutput: true, // this defaults to true, use no-silent or silent to switch value
allowCollectUsageStats: true, // allow Suman to collect usage information (no performance penalty)
//integers
saveLogsForThisManyPastRuns: 5,
verbosity: 5,
maxParallelProcesses: Math.max(6, numOfCPUs), //maximum parallel processes running at one time, synonymous with --concurrency cmd line option
resultsCapCount: 100, // test results will be deleted if they are 101st oldest run
resultsCapSize: 7000, // 3 gb's // oldest test results will be deleted if the results dir expands beyond this size
//integers in millis
defaultHookTimeout: 5000,
defaultTestCaseTimeout: 5000,
timeoutToSearchForAvailServer: 2000,
defaultDelayFunctionTimeout: 8000,
defaultChildProcessTimeout: 8000000, //used with Suman runner, to kill child process if it has not exited beforehand
defaultTestSuiteTimeout: 15000,
expireResultsAfter: 10000000, // test results will be deleted after this amount of time
//objects
coverage: {
coverageDir: 'coverage',
nyc: {
use: false,
},
istanbul: {}
},
watch: {
'//tests': {
'default': { // (re) execute the test file that changed
script: function (p) {
return `./node_modules/.bin/suman ${p}`
},
include: [],
exclude: ['^test.*']
}
},
'//project': {
'default': { //run all tests when a file changes in project
script: './node_modules/.bin/suman',
include: [],
exclude: ['^test.*']
}
},
},
reporters: {
'tap': 'suman/reporters/tap'
},
servers: { // list of servers to output test result data to, with the os.hostname() as the key
'*default': {
host: '127.0.0.1',
port: 6969
},
'###': { /// replace this with user's local machines os.hostname()
host: '127.0.0.1',
port: 6969
},
},
babelRegisterOpts: {
// Optional ignore regex - if any filenames match this regex then they
// aren't compiled.
ignore: /fixture/,
// Ignore can also be specified as a function.
// ignore: function(filename) {
// if (filename === '/path/to/es6-file.js') {
// return false;
// } else {
// return true;
// }
// },
// Optional only regex - if any filenames *don't* match this regex then they
// aren't compiled
// only: /my_es6_folder/,
// Setting this will remove the currently hooked extensions of .es6, `.es`, `.jsx`
// and .js so you'll have to add them back if you want them to be used again.
extensions: ['.es6', '.es', '.jsx', '.js']
}
});