diff --git a/src/test_manifest_job/package.json b/src/test_manifest_job/package.json index b250d76..ad128a9 100644 --- a/src/test_manifest_job/package.json +++ b/src/test_manifest_job/package.json @@ -6,7 +6,7 @@ "scripts": { "test": "mocha wppChecker.js --require mocha-step --colors" }, - "author": "PtiSimon", + "author": "Simon", "license": "ISC", "dependencies": { "ajv": "^8.5.0", @@ -15,4 +15,4 @@ "mocha": "^8.4.0", "mocha-steps": "^1.3.0" } -} +} \ No newline at end of file diff --git a/src/test_manifest_job/wpp_checker.js b/src/test_manifest_job/wpp_checker.js index 0cdbd7a..3846df4 100644 --- a/src/test_manifest_job/wpp_checker.js +++ b/src/test_manifest_job/wpp_checker.js @@ -37,14 +37,14 @@ function flatReferences(wppManifest) { describe('Mandatory Checks', function () { before(function () { - slug = env.PACKAGE_NAME; + const slug = env.PACKAGE_NAME; expect(slug).to.be.a("string").that.is.not.empty; - root = env.ENTRY_FOLDER; + const root = env.ENTRY_FOLDER; expect(root).to.be.a("string").that.is.not.empty; - workingDirectory = path.join(root, slug); - files = fs.readdirSync(workingDirectory); + const workingDirectory = path.join(root, slug); + const files = fs.readdirSync(workingDirectory); expect(files).to.be.an('array').that.is.not.empty; - validator = ajv.compile(JSON.parse(fs.readFileSync(themeSchemaFile, 'utf8'))); + let validator = ajv.compile(JSON.parse(fs.readFileSync(themeSchemaFile, 'utf8'))); }); step('Manifest is an existing json file', function () { @@ -59,7 +59,7 @@ describe('Mandatory Checks', function () { step('There are no missing files', function () { let references = flatReferences(wppManifest); references.push("theme.json"); - missings = leftOuterJoin(references, files); + let missings = leftOuterJoin(references, files); expect(missings, `The following reference${(missings.length > 1) ? "s" : ""} from theme.json ${(missings.length > 1) ? "are" : "is"} missing in the pack. Consider adding ${(missings.length > 1) ? "them" : " it"} to the pack or removing the reference${(missings.length > 1) ? "s" : ""} from the theme.json:\n\t• ${missings.join('\n\t• ')}\n` ).to.be.lengthOf(0,); @@ -67,7 +67,7 @@ describe('Mandatory Checks', function () { step('There are no orphan files', function () { let references = flatReferences(wppManifest); - orphans = leftOuterJoin(files.filter(x => x !== "theme.json"), references); + let orphans = leftOuterJoin(files.filter(x => x !== "theme.json"), references); expect(orphans, `The following orphan file${(orphans.length > 1) ? "s are" : " is"} not referenced in this theme.json. Consider removing the file${(orphans.length > 1) ? "s" : ""} or referencing ${(orphans.length > 1) ? "them" : "it"} in the theme.json:\n\t• ${orphans.join('\n\t• ')}\n` ).to.be.lengthOf(0);