@iobroker/testing 5.2.1 → 5.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -291,12 +291,26 @@ function validatePackageFiles(adapterDir) {
|
|
|
291
291
|
});
|
|
292
292
|
});
|
|
293
293
|
describe(`Validate JSON files`, () => {
|
|
294
|
+
// Validate base directory JSON files
|
|
295
|
+
describe(`Base directory JSON files`, () => {
|
|
296
|
+
for (const filename of ['package.json', 'io-package.json']) {
|
|
297
|
+
const filePath = path.join(adapterDir, filename);
|
|
298
|
+
if (fs.existsSync(filePath)) {
|
|
299
|
+
it(`${filename} contains valid JSON`, () => {
|
|
300
|
+
(0, chai_1.expect)(() => {
|
|
301
|
+
JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
302
|
+
}, `${filename} contains invalid JSON!`).not.to.throw();
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
});
|
|
294
307
|
// Find all JSON and JSON5 files in admin/ directory (recursively)
|
|
295
308
|
const adminDir = path.join(adapterDir, 'admin');
|
|
296
309
|
const allAdminJsonFiles = findFiles(adminDir, /\.json$/);
|
|
297
310
|
const allAdminJson5Files = findFiles(adminDir, /\.json5$/);
|
|
298
311
|
// Split JSON files into admin/*.json and admin/i18n/**/*.json
|
|
299
|
-
|
|
312
|
+
// Exclude tsconfig.json as it may contain JSON5 syntax (comments, trailing commas)
|
|
313
|
+
const adminDirectJsonFiles = allAdminJsonFiles.filter(file => !file.includes(`${path.sep}i18n${path.sep}`) && !file.endsWith(`${path.sep}tsconfig.json`));
|
|
300
314
|
const i18nJsonFiles = allAdminJsonFiles.filter(file => file.includes(`${path.sep}i18n${path.sep}`));
|
|
301
315
|
if (adminDirectJsonFiles.length > 0) {
|
|
302
316
|
describe(`admin/*.json files`, () => {
|