From ac38241629f1b18f9ad5b88b3d7fc7e584e171cc Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 13 May 2023 22:54:22 +0200 Subject: [PATCH] =?UTF-8?q?Fixes=20plusieurs=20probl=C3=A8mes=20pour=20che?= =?UTF-8?q?cker=20le=20theme.json=20g=C3=A9n=C3=A9r=C3=A9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduit aussi un launch.json pour mes réinstallations futures de VScode. Supprime la description.md qui fait échouter ce test prévu pour réussir. --- .vscode/launch.json | 30 ++++++++++++++++++++++++++++ src/test_manifest_job/package.json | 2 +- src/test_manifest_job/wpp_checker.js | 2 +- test/valid_set/description.md | 3 --- test/valid_set/theme.json | 19 ++++++++++++++++++ 5 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 .vscode/launch.json delete mode 100644 test/valid_set/description.md create mode 100644 test/valid_set/theme.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..7ac5fa6 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,30 @@ +{ + // Utilisez IntelliSense pour en savoir plus sur les attributs possibles. + // Pointez pour afficher la description des attributs existants. + // Pour plus d'informations, visitez : https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Tester avec Valid_set", + "skipFiles": [ + "/**" + ], + "program": "${workspaceFolder}/src/test_manifest_job/node_modules/mocha/bin/_mocha", + "args": [ + "${workspaceFolder}/src/test_manifest_job/wpp_checker.js", + "--require mocha-steps", + "--colors", + ], + "env": { + "ENTRY_FOLDER": "test", + "PACKAGE_NAME": "valid_set" + }, + "internalConsoleOptions": "openOnSessionStart", + "console": "integratedTerminal", + "cwd": "${workspaceFolder}", + "autoAttachChildProcesses": true, + } + ] +} \ No newline at end of file diff --git a/src/test_manifest_job/package.json b/src/test_manifest_job/package.json index 1458c7c..86af811 100644 --- a/src/test_manifest_job/package.json +++ b/src/test_manifest_job/package.json @@ -4,7 +4,7 @@ "description": "", "main": "wpp_checker.js", "scripts": { - "test": "mocha wpp_checker.js --require mocha-steps --colors" + "test": "src/test_manifest_job/node_modules/mocha/bin/_mocha --require mocha-steps --colors src/test_manifest_job/wpp_checker.js" }, "author": "Simon", "license": "ISC", diff --git a/src/test_manifest_job/wpp_checker.js b/src/test_manifest_job/wpp_checker.js index 21d523b..a026224 100644 --- a/src/test_manifest_job/wpp_checker.js +++ b/src/test_manifest_job/wpp_checker.js @@ -42,7 +42,7 @@ describe('Mandatory Checks', function () { const root = process.env["ENTRY_FOLDER"]; expect(root).to.be.a("string").that.is.not.empty; workingDirectory = path.join(root, slug); - const files = fs.readdirSync(workingDirectory); + files = fs.readdirSync(workingDirectory); expect(files).to.be.an('array').that.is.not.empty; validator = ajv.compile(JSON.parse(fs.readFileSync(themeSchemaFile, 'utf8'))); }); diff --git a/test/valid_set/description.md b/test/valid_set/description.md deleted file mode 100644 index aad958a..0000000 --- a/test/valid_set/description.md +++ /dev/null @@ -1,3 +0,0 @@ -# some descriptions - -Introducting change for testing. diff --git a/test/valid_set/theme.json b/test/valid_set/theme.json new file mode 100644 index 0000000..4653a60 --- /dev/null +++ b/test/valid_set/theme.json @@ -0,0 +1,19 @@ +{ + "dayImageList": [ + 1 + ], + "nightImageList": [ + 3 + ], + "sunsetImageList": [ + 2 + ], + "sunriseImageList": [ + 4 + ], + "imageFilename": "bl2_eridum_badlands_*.jpg", + "imageCredits": "© Thoscellen, © 2K Games, © Gearbox Software", + "displayName": "Eridum Badlands", + "dayHighlight": 1, + "nightHighlight": 3 +} \ No newline at end of file