power-assert-js/power-assert

any tool to migrate `should/expect` code to `power-assert`?

atian25 opened this issue ยท 7 comments

power-assert is amazing

Hello! No, we don't have it, but it would be not hard to do manually since power-assert has only one method assert.

but should is complex, such as:

  • should.be.ok(someVar)
  • someKey.should.not.exist()
  • someKey.should.eql('aaa')
  • should.throw(() => {})

Yeah, it's complicated and multifunctional indeed. Well, the behaviour of the should/expect could depend on the tools/its syntax design, and that's why I think the migration topic could be out of the scope of this project, IMO.

twada commented

@atian25 @watilde Thank you for your feature request! It's good to have migration path to assert.

Just begun chai-to-assert, a jscodeshift codemod that transforms from chai to assert. Highly experimental ;)

twada commented

@atian25 Wow great! Now we have migration paths from both should.js and chai!