A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/power-assert-js/power-assert/issues/85 below:

Unable to compose power-assert + espower in vanilla node 7 or 8 · Issue #85 · power-assert-js/power-assert · GitHub

I am trying to use power-assert to get pretty assert output in node, without using mocha or babel.

I'm trying to implement assertions by reading the documentation, but haven't been able to get it working so far.

Here is my attempt at a "vanilla node" (no mocha) seed: https://github.com/TehShrike/power-assert-espower-repro

entry point:

require('espower-loader')({
	pattern: 'test/*.js',
})

require('./test/test.js')

test/test.js:

const assert = require('power-assert')

const test = () => {
	const value1 = true
	const value2 = 3
	assert.deepEqual({ value: value1 }, { value: value2 })
}

test()

Instead of a nice pretty error message, I get:

/Users/josh/code/power-assert-espower-repro/node_modules/empower-core/lib/decorator.js:110
        ret = func.apply(thisObj, args);
                   ^
AssertionError: { value: true } deepEqual { value: 3 }
    at Decorator._callFunc (/Users/josh/code/power-assert-espower-repro/node_modules/empower-core/lib/decorator.js:110:20)
(snip)

What am I missing? I'm guessing this is a documentation/implementation issue, and not an actual bug.

(node 7.6.0)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4