Skip to content

Commit

Permalink
test: improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Feb 10, 2025
1 parent c1320e7 commit ebef69a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async function run() {

const errors = [];

console.log('Fetching translation keys');
console.log('INFO: Fetching translation keys');

const translationsKeys = await fetch(translationsUrl).then(response => response.text());

Expand All @@ -26,12 +26,12 @@ async function run() {
writeTranslation('en.js', translationsEnglish);
}

console.log('Verifying translations');
console.log('INFO: Verifying translations');

for (const translationPath of translationPaths) {
const name = translationPath.split('.')[ 0 ].toUpperCase();

console.log(`Verifying ${ name } translations`);
console.log(`INFO: Verifying ${ name } translations`);

try {
const { default: translations } = await import(`../translations/${translationPath}`);
Expand Down Expand Up @@ -60,16 +60,12 @@ async function run() {
stats.ok.push(key);
} else {
stats.missing.push(key);

process.env.VERBOSE && console.log(`Missing translation <${ key }>`);
}
}

for (const key in translationsOrdered) {
if (!(key in translationsEnglish)) {
stats.unknown.push(key);

process.env.VERBOSE && console.log(`Unknown translation <${ key }>`);
}
}

Expand Down

0 comments on commit ebef69a

Please sign in to comment.