caolan / caolan/nodeunit

test.equal prints values in incorrect order for Boolean values

Abierto
#175 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
1.9k
Forks
359
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

test.equal(1, 2) prints values in this order
test.equal(false, true) prints values in reverse order
## reproduction printout

```
$ nodeunit ../nodejs3/snippets/modules/nodeunit/nodeunit-order.js

nodeunit-order.js
assert module works as expected
BUG: As of nodeunit 0.7.4, the order of the boolean values is swapped.
The second error should be "AssertionError: false == true" not "AssertionError: true == false"
✖ f

AssertionError: 1 == 2
at Object.assertWrapper [as equal] (/usr/local/lib/node_modules/nodeunit/lib/types.js:83:39)
at Object.module.exports.f (/home/foxyboy/Desktop/c505/node/nodejs3/snippets/modules/nodeunit/nodeunit-order.js:25:7)
at Object.wrapTest (/usr/local/lib/node_modules/nodeunit/lib/core.js:235:16)
at wrapTest (/usr/local/lib/node_modules/nodeunit/lib/core.js:235:16)
at Object.exports.runTest (/usr/local/lib/node_modules/nodeunit/lib/core.js:69:9)
at exports.runSuite (/usr/local/lib/node_modules/nodeunit/lib/core.js:117:25)
at _concat (/usr/local/lib/node_modules/nodeunit/deps/async.js:508:13)
at async.forEachSeries.iterate (/usr/local/lib/node_modules/nodeunit/deps/async.js:118:13)
at async.forEachSeries (/usr/local/lib/node_modules/nodeunit/deps/async.js:134:9)
at _concat (/usr/local/lib/node_modules/nodeunit/deps/async.js:507:9)

AssertionError: true == false
at Object.assertWrapper [as equal] (/usr/local/lib/node_modules/nodeunit/lib/types.js:83:39)
at Object.module.exports.f (/home/foxyboy/Desktop/c505/node/nodejs3/snippets/modules/nodeunit/nodeunit-order.js:26:7)
at Object.wrapTest (/usr/local/lib/node_modules/nodeunit/lib/core.js:235:16)
at wrapTest (/usr/local/lib/node_modules/nodeunit/lib/core.js:235:16)
at Object.exports.runTest (/usr/local/lib/node_modules/nodeunit/lib/core.js:69:9)
at exports.runSuite (/usr/local/lib/node_modules/nodeunit/lib/core.js:117:25)
at _concat (/usr/local/lib/node_modules/nodeunit/deps/async.js:508:13)
at async.forEachSeries.iterate (/usr/local/lib/node_modules/nodeunit/deps/async.js:118:13)
at async.forEachSeries (/usr/local/lib/node_modules/nodeunit/deps/async.js:134:9)
at _concat (/usr/local/lib/node_modules/nodeunit/deps/async.js:507:9)

FAILURES: 2/2 assertions failed (4ms)
```
## reproduction code

``` js
// nodeunit-order.js

var assert = require('assert')

module.exports.f = function (test) {

// check assert
try {
assert.equal(1, 2)
} catch(e) {
if (e.toString() != 'AssertionError: 1 == 2') throw Error()
}
try {
assert.equal(false, true)
} catch(e) {
if (e.toString() != 'AssertionError: false == true') throw Error(e)
}
console.log('assert module works as expected')

console.log('BUG: As of nodeunit 0.7.4, the order of the boolean values is swapped.')
console.log('The second error should be ' +
'"AssertionError: false == true"' +
' not ' +
'"AssertionError: true == false"')
test.equal(1, 2)
test.equal(false, true)
test.done()
}
```

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.