Skip to content

Commit 3159da1

Browse files
committed
Additional touch ups
1 parent 780c51a commit 3159da1

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ function multiLine (fileText, start, type) {
183183
.substring(fileText[end].indexOf('*') + 1)
184184
.trim()
185185

186-
text += ' ' + addition
186+
text += '\n' + addition
187187

188188
try {
189189
// attempt a parse, if it succeeds, flag it as successful & use that.
@@ -256,14 +256,14 @@ main()
256256
*/
257257
function exportedOnly (exports) {
258258
return i => {
259-
if (!i.tags.length) { return false }
259+
if (!i.tags.length) return false
260260

261261
if (!i.exported) {
262262
if (exports[i.name]) {
263263
i.originalName = i.name
264264
i.name = exports[i.name]
265265
return true
266-
} else { console.log(logSymbols.warning, `Function / Class "${i.name}" is not exported from ${i.fileName}, skipping its tests.`) }
266+
} else console.log(logSymbols.warning, `Function / Class "${i.name}" is not exported from ${i.fileName}, skipping its tests.`)
267267
}
268268
return i.exported
269269
}
@@ -290,7 +290,7 @@ function getFileExports (file) {
290290
if (i.includes(':')) {
291291
const [key, value] = i.split(':').map(i => i.trim())
292292
if (/^[A-Za-z$_][A-Za-z$_0-9]+$/.test(key)) { exports[key] = value }
293-
} else { exports[i.trim()] = i.trim() }
293+
} else exports[i.trim()] = i.trim()
294294
})
295295
} else {
296296
// support module.exports = func at some point

run.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ export async function run (input, id, func) {
6565
return result
6666
}
6767

68+
const format = text => text.includes('\n') ? `\n${text}\n` : text
69+
6870
try {
6971
const [, success, message] = await internalRun(input, id, func)
7072

7173
if (!success) {
72-
console.log(logSymbols.error, `Failed test (${id.split('.')[0]}):`, input)
74+
console.log(logSymbols.error, `Failed test (${id.split('.')[0]}):`, format(input))
7375
if (message) {
7476
console.log(message)
7577
console.log()
@@ -87,7 +89,7 @@ export async function run (input, id, func) {
8789
return 1
8890
}
8991

90-
console.log(logSymbols.success, `Passed test (${id.split('.')[0]}):`, input)
92+
console.log(logSymbols.success, `Passed test (${id.split('.')[0]}):`, format(input))
9193
return 0
9294
}
9395

0 commit comments

Comments
 (0)