JSPM

jest-cli

0.0.8-pre
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 34164848
  • Score
    100M100P100Q205094F

Package Exports

  • jest-cli/bin/jest
  • jest-cli/bin/jest.js
  • jest-cli/package.json
  • jest-cli/src/lib/moduleMocker
  • jest-cli/src/lib/utils

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jest-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Jest

Painless JavaScript Unit Testing

  • Familiar Approach: Built on top of Jasmine test framework, a familiar BDD testing environment

  • Mock by Default: Automatically mocks CommonJS modules returned by require(), making most existing code testable

  • Short Feedback Loop: Tests run in parallel and DOM apis are mocked so you can run tests on the command line

Getting Started

Check out the Getting Started tutorial for more in-depth details.

API

#### The `jest` object

Mock functions

Config options

Globally injected variables

  • jest
  • require(module)
  • require.requireActual(module)
  • describe(name, fn)
  • beforeEach(fn)
  • afterEach(fn)
  • it(name, fn)
  • it.only(name, fn) executes only this test. Useful when investigating a failure
  • pit(name, fn) helper for promises

expect(value)

  • .not inverse the next comparison
  • .toThrow(?message)
  • .toBe(value) comparison using ===
  • .toEqual(value) deep comparison. Use jasmine.any(type) to be softer
  • .toBeFalsy()
  • .toBeTruthy()
  • .toBeNull()
  • .toBeUndefined()
  • .toBeDefined()
  • .toMatch(regexp)
  • .toContain(string)
  • .toBeCloseTo(number, delta)
  • .toBeGreaterThan(number)
  • .toBeLessThan(number)
  • .toBeCalled()
  • .toBeCalledWith(arg, um, ents)
  • .lastCalledWith(arg, um, ents)