Skip to content

Commit aa99281

Browse files
committed
fix(tests): allow theme to have more fields and accept repository field
1 parent c3f7298 commit aa99281

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/themes.check.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ themes.forEach((entry, index) => {
1111
keys[1] !== 'link' ||
1212
keys[2] !== 'description' ||
1313
keys[3] !== 'image' ||
14-
keys[4] !== 'tags'
14+
keys[4] !== 'tags' ||
15+
keys[5] !== 'repository'
1516
const objectTypes = typeof entry[keys[0]] !== 'string' ||
1617
typeof entry[keys[1]] !== 'string' ||
1718
typeof entry[keys[2]] !== 'string' ||
1819
typeof entry[keys[3]] !== 'string' ||
19-
typeof entry[keys[4]] !== 'object'
20+
typeof entry[keys[4]] !== 'object' !!
21+
typeof entry[keys[5]] !== 'string'
2022

2123
if (typeof entry !== 'object') currentBugs.push('This theme is not an object.')
22-
if (keys.length !== 5) currentBugs.push(`Is expected to have 5 key but has ${keys.length}.`)
24+
if (keys.length < 6) currentBugs.push(`Is expected to have at least 6 keys, but has ${keys.length}.`)
2325
if (objectKeys) currentBugs.push('Verify name of object keys, respectively, it must be: title, link, description, image, tags')
2426
if (objectTypes) currentBugs.push('All object entries must be strings with the exception of tags, which is an array!')
2527

0 commit comments

Comments
 (0)