Skip to content

Commit

Permalink
Sync CI with official repository
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 1, 2024
1 parent b6dd04e commit 888fc6d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .ci/eslint-plugin-zotero-translator/lib/rules/test-cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,15 @@ module.exports = {
});
}
else if (testCase.type === 'search') {
const expected = ['DOI', 'ISBN', 'PMID', 'identifiers', 'contextObject', 'adsBibcode', 'ericNumber', 'openAlex'];
const keys = Array.isArray(testCase.input) ? testCase.input.flatMap(Object.keys) : Object.keys(testCase.input);

// console.log(JSON.stringify(testCase.input))
const expected = ['DOI', 'ISBN', 'PMID', 'arXiv', 'identifiers', 'contextObject', 'adsBibcode', 'ericNumber', 'openAlex'];
let keys;
if (Array.isArray(testCase.input)) {
keys = testCase.input.flatMap(Object.keys);
}
else {
keys = Object.keys(testCase.input);
}
if (!keys.every(key => expected.includes(key))) {
const invalidKey = keys.find(key => !expected.includes(key));
context.report({
Expand Down

0 comments on commit 888fc6d

Please sign in to comment.