Skip to content

Commit

Permalink
Fixing bugs introduced by the big next merge
Browse files Browse the repository at this point in the history
- Update package-lock.json
- Remove (failing) dupe ospec suite

Git didn't *quite* do the right thing here, so I had to fix a few
things.
  • Loading branch information
dead-claudia committed Oct 25, 2018
1 parent 2635070 commit 97b6125
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 73 deletions.
72 changes: 0 additions & 72 deletions ospec/tests/test-ospec.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,78 +134,6 @@ o.spec("reporting", function() {
})
})


new function(o) {
var clone = o.new()

clone.spec("clone", function() {
clone("fail", function() {
clone(true).equals(false)
})

clone("pass", function() {
clone(true).equals(true)
})
})

// Predicate test passing on clone results
o.spec("reporting", function() {
o("reports per instance", function(done, timeout) {
timeout(100) // Waiting on clone

clone.run(function(results) {
o(typeof results).equals("object")
o("length" in results).equals(true)
o(results.length).equals(2)("Two results")

o("error" in results[0] && "pass" in results[0]).equals(true)("error and pass keys present in failing result")
o(!("error" in results[1]) && "pass" in results[1]).equals(true)("only pass key present in passing result")
o(results[0].pass).equals(false)("Test meant to fail has failed")
o(results[1].pass).equals(true)("Test meant to pass has passed")

done()
})
})
o("o.report() returns the number of failures", function () {
var log = console.log, error = console.error
console.log = o.spy()
console.error = o.spy()

function makeError(msg) {try{throw msg ? new Error(msg) : new Error} catch(e){return e}}
try {
var errCount = o.report([{pass: true}, {pass: true}])

o(errCount).equals(0)
o(console.log.callCount).equals(1)
o(console.error.callCount).equals(0)

errCount = o.report([
{pass: false, error: makeError("hey"), message: "hey"}
])

o(errCount).equals(1)
o(console.log.callCount).equals(2)
o(console.error.callCount).equals(1)

errCount = o.report([
{pass: false, error: makeError("hey"), message: "hey"},
{pass: true},
{pass: false, error: makeError("ho"), message: "ho"}
])

o(errCount).equals(2)
o(console.log.callCount).equals(3)
o(console.error.callCount).equals(3)
} catch (e) {
o(1).equals(0)("Error while testing the reporter")
}

console.log = log
console.error = error
})
})
}(o)

o.spec("ospec", function() {
o.spec("sync", function() {
var a = 0, b = 0, illegalAssertionThrows = false
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 97b6125

Please sign in to comment.