Update records.test.js

This commit is contained in:
Jon authored and GitHub committed 2024-11-17 16:33:15 -05:00
1 parent 654f8c4cd1
commit eb9f00c97a
1 file changed
+12 -1
+12 -1
View File
@@ -121,9 +121,20 @@ t("All files should have valid record types", (t) => {
});
});
function isDirectory(filePath) {
return fs.lstatSync(filePath).isDirectory();
}
t("All files should not have duplicate record keys", (t) => {
files.forEach((file) => {
const data = fs.readJsonSync(path.join(domainsPath, file));
const filePath = path.join(domainsPath, file);
// Skip directories
if (isDirectory(filePath)) {
return;
}
const data = fs.readJsonSync(filePath);
const recordKeys = Object.keys(data.record);
const uniqueRecordKeys = new Set(recordKeys);