Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

chai-to-assert

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chai-to-assert

chai to assert codemod

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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.

Keywords

assert

FAQs

Package last updated on 14 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts