power-assert-js/power-assert

`global.assert = require('assert')` problem

atian25 opened this issue · 5 comments

global.assert = require('assert');
describe('test/showcase.test.js', () => {
  const arr = [ 1, 2, 3 ];

  it('power-assert', () => {
    assert(arr[1] === 10);
  });
});

then the unit test passed...

twada commented

@atian25 Thank you for reporting!

Ah, false positives... It's a bit hard problem but I have to wrestle with this.

If you rely on global assert object, please use power-assert for the global.assert for a while.
(Your temporary fix is right)

Thanks.

Thanks for quick response.

btw, global.assert = require('assert'); is used at test/.setup.js, a DOT file.

hey, @twada any good news on this?

twada commented

@atian25 Thanks for pinging me.
Planning. This issue will be fixed by power-assert 2.0.0 (since the fix causes breaking change).

@twada great, any roadmap for 2.0 ?