chai-to-assert

1.0.0 • Public • Published

chai-to-assert

A jscodeshift codemod that transforms from chai to Node assert.

Build Status NPM version Code Style License

USAGE

$ npm install -g jscodeshift
$ npm install chai-to-assert
$ jscodeshift -t node_modules/chai-to-assert/lib/bdd-api-to-node-assert.js target-dir

FEATURES

BDD Style API

  • expect
  • should

properties

  • .ok
  • .true
  • .false
  • .null
  • .undefined
  • .exist
  • .NaN
  • .finite
  • .extensible
  • .sealed
  • .frozen

chainable methods

  • .a(type) (alias an) (only for primitives and null)
  • .lengthOf(value) (alias .length)

methods

  • .equal(value) (alias .equals, .eq)
  • .eql(value) (alias .eqls)
  • .match(regexp) (alias .matches)
  • .above(value) (alias .gt, .greaterThan)
  • .least(value) (alias .gte)
  • .below(value) (alias .lt, .lessThan)
  • .most(value) (alias .lte)
  • .within(start, finish)
  • .closeTo(expected, delta) (alias .approximately)
  • .property(name, [value])
  • .ownProperty(name, [value]) (alias .haveOwnProperty)
  • .ownPropertyDescriptor(name, [descriptor]) (alias .haveOwnPropertyDescriptor)
  • .instanceof(constructor) (alias .instanceOf)
  • .throw([errorLike], [errMsgMatcher]) (alias .throws, .Throw)
  • .respondTo(method) (alias .respondsTo)
  • .satisfy(predicate) (alias .satisfies)
  • .string(string)
  • .oneOf(list)

AUTHOR

LICENSE

Licensed under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i chai-to-assert

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • twada