-
Notifications
You must be signed in to change notification settings - Fork 1
/
mocha-plus.js
60 lines (52 loc) · 1.71 KB
/
mocha-plus.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
'use strict';
// Todo: Move to own repo so can add dependencies
module.exports = {
overrides: [
{
files: ['**/test/**', '**/tests/**', 'cypress/integration/**'],
plugins: [
'chai-assert-bdd'
],
extends: [
'plugin:mocha/recommended',
'plugin:mocha-cleanup/recommended-no-limits',
'plugin:@fintechstudios/chai-as-promised/recommended',
'plugin:chai-expect-keywords/recommended',
'plugin:chai-expect/recommended',
'plugin:chai-friendly/recommended'
],
rules: {
// CHAI
'chai-expect-keywords/no-unsupported-keywords': [
'error', {
// allowKeywords: ["length"],
// Will admittedly vary by project but a bit of a hassle to
// whitelist differently for each project
allowChaiAsPromised: true,
allowChaiDOM: true,
allowSinonChai: true
}
],
// MOCHA
// Too oppressive when planning to extend a section
'mocha/no-hooks-for-single-case': 0,
// Useful to ensure allowing `this.timeout()`, etc., but a
// little oppressive
'mocha/no-mocha-arrows': 0,
// Useful if enabling the regular `prefer-arrow-callback`
// 'mocha/prefer-arrow-callback': 2
// Would be good to enable but can need some refactoring
'mocha/no-setup-in-describe': 0,
// MOCHA-CLEANUP
'mocha-cleanup/no-outside-declaration': 0
/*
// Might see about working around to avoid the option limitation,
// but convenient
'mocha-cleanup/no-expressions-in-assertions': ['error', {
replacementsOnly: true
}]
*/
}
}
]
};