Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/l0o0/translators_CN
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaojiaodubai committed Nov 1, 2024
2 parents e35048e + 888fc6d commit ba89f59
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 ba89f59

Please sign in to comment.