test: restore commented-out i18n test

isekai-main
Julian Lam 3 years ago
parent 2bed40bed0
commit fa1afbcf4a

@ -89,21 +89,21 @@ describe('i18n', () => {
});
it('should contain every translation key contained in its source counterpart', () => {
// const sourceArr = Array.from(sourceStrings.keys());
// sourceArr.forEach((namespace) => {
// const sourceKeys = Object.keys(sourceStrings.get(namespace));
// const translationKeys = Object.keys(strings.get(namespace));
// assert(sourceKeys && translationKeys);
// sourceKeys.forEach((key) => {
// assert(translationKeys.includes(key), `${namespace.slice(1, -5)}:${key} missing in ${language}`);
// });
// assert.strictEqual(
// sourceKeys.length,
// translationKeys.length,
// `Extra keys found in namespace ${namespace.slice(1, -5)} for language "${language}"`
// );
// });
const sourceArr = Array.from(sourceStrings.keys());
sourceArr.forEach((namespace) => {
const sourceKeys = Object.keys(sourceStrings.get(namespace));
const translationKeys = Object.keys(strings.get(namespace));
assert(sourceKeys && translationKeys);
sourceKeys.forEach((key) => {
assert(translationKeys.includes(key), `${namespace.slice(1, -5)}:${key} missing in ${language}`);
});
assert.strictEqual(
sourceKeys.length,
translationKeys.length,
`Extra keys found in namespace ${namespace.slice(1, -5)} for language "${language}"`
);
});
});
});
});

Loading…
Cancel
Save