Skip to content

Commit

Permalink
Better error msg for count check
Browse files Browse the repository at this point in the history
  • Loading branch information
HalvorHaugan committed Nov 20, 2024
1 parent 500102d commit 2bae3eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion @navikt/core/react/src/util/i18n/locales.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ function checkPlaceholders(
});
// Check that the translation does not have any extra (hence invalid) placeholders
const transPlaceholders = transToCheck.match(/{[^}]*}/g) || [];
expect(correctPlaceholders.length).toBe(transPlaceholders.length);
expect(
transPlaceholders.length,
`Invalid placeholder(s): "${transToCheck}" (key=${key})`,
).toBe(correctPlaceholders.length);
}
});
}
Expand Down

0 comments on commit 2bae3eb

Please sign in to comment.