Skip to content

Commit

Permalink
Test release
Browse files Browse the repository at this point in the history
  • Loading branch information
coreybutler committed Jun 25, 2020
1 parent 259357a commit 8c119ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions lib/suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ export default class TestSuite {
}

format (element, newline = false) {
if (element === undefined) {
return ''
}

const prefix = newline ? ' | \n' : ' '

switch (typeof element) {
Expand All @@ -195,14 +199,7 @@ export default class TestSuite {
}

if (expected !== actual) {
if (typeof expected === 'object') {
expected = JSON.stringify(expected, null, 2).split('\n').map(r => ` ${r}`).join('\n')
}
if (typeof actual === 'object') {
actual = JSON.stringify(actual, null, 2).split('\n').map(r => ` ${r}`).join('\n')
}

this.failinfo(expected, actual, msg, directive)
this.failinfo(this.format(expected), this.format(actual), msg, directive)
} else {
this.pass(msg, directive)
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tappedout",
"version": "0.2.1",
"version": "1.0.0-alpha",
"description": "A simple \"back to basics\" JavaScript test runner for producing TAP-formatted results. Built using ES Modules.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 8c119ba

Please sign in to comment.