-
Notifications
You must be signed in to change notification settings - Fork 3
/
tests.yaml
34 lines (31 loc) · 993 Bytes
/
tests.yaml
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
- name: Check for enable_upgrades key
test: |
(key, value, path, obj) => {
if (key === 'restrictions' && !obj.hasOwnProperty('enable_upgrades')) {
return "Missing 'enable_upgrades' key";
}
}
- name: Check for flagship key
test: |
(key, value, path, obj) => {
if (key === 'restrictions' && !obj.hasOwnProperty('complex_restrictions')) {
return "Missing 'complex_restrictions' key";
}
}
- name: Check cardimage
test: |
(key, value, path) => {
if (key === 'cardimage' && (!value || !value.startsWith('https://') || value.includes('lensdump'))) {
return "Invalid cardimage link";
}
}
- name: Check cardimage key match
test: |
(key, value, path, obj) => {
if (key === 'cardimage' && value) {
const parentKey = path.split('.').slice(-2, -1)[0];
if (!value.includes(parentKey)) {
return `Cardimage link does not contain the key '${parentKey}'`;
}
}
}