aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test.js
diff options
context:
space:
mode:
authorDave Lockwood <1261876+deamos@users.noreply.github.com>2019-09-30 00:29:40 +0000
committerGitHub <noreply@github.com>2019-09-30 00:29:40 +0000
commit2518c3f1116d425c9eea2062656f130499d514cf (patch)
treea07aa1c63371b33d09a516305176a814c084a7a1 /tests/test.js
parentAdd Open Streaming Platform (diff)
parentMerge pull request #1808 from nodiscc/feed-readers-cleanup (diff)
downloadawesome-selfhosted-2518c3f1116d425c9eea2062656f130499d514cf.tar.gz
awesome-selfhosted-2518c3f1116d425c9eea2062656f130499d514cf.zip
Merge pull request #1 from Kickball/master
merge
Diffstat (limited to '')
-rw-r--r--tests/test.js (renamed from test.js)10
1 files changed, 8 insertions, 2 deletions
diff --git a/test.js b/tests/test.js
index 94e7798c..6516ab07 100644
--- a/test.js
+++ b/tests/test.js
@@ -4,7 +4,7 @@ const fs = require('fs');
let log = '{\n';
let issuelog = ' "message": "#### Syntax Issues\\n\\n Name | Entry\\n----|----------------------\\n';
-
+let fails = ''
const file = fs.readFileSync(process.argv[2], 'utf8'); // Reads argv into var file
function entryFilter(md) { // Function to find lines with entries
@@ -52,6 +52,10 @@ function entryErrorCheck(md) {
let totalPass = 0;
let total = 0;
const entryArray = [];
+ if (entries[0] === "") {
+ console.log("0 Entries")
+ process.exit(0)
+ }
for (let i = 0, len = entries.length; i < len; i += 1) { // Loop to create array of objects
entryArray[i] = new Object;
entryArray[i].raw = entries[i];
@@ -66,11 +70,13 @@ function entryErrorCheck(md) {
// entryArray[i].error = findError(entries[i]) //WIP
totalFail += 1;
issuelog += `${entryArray[i].name} | ${entries[i]} \\n`;
+ fails += `${entries[i]} \n\n`;
}
}
}
if (totalFail > 0) { // Logs # passed & failed to console, and failures to syntaxcheck.json
- console.log(`${totalFail} Failed, ${totalPass} Passed, of ${total}`);
+ console.log(`${totalFail} Failed, ${totalPass} Passed, of ${total}\n-----------------------------`);
+ console.log(fails)
log += ` "error": true,\n "title": "Found ${totalFail} entries with syntax error(s).",\n`;
fs.writeFileSync('syntaxcheck.json', `${log} ${issuelog} "\n}`);
process.exit(1);