expect

Atom snippet package for npm expect@1.x assertion library

MikeBruns

277

0

0.6.1

MIT

GitHub

expect

License MIT Build Build status

Atom snippet package for general expect statements based on mjackson/expect assertion library.

Example

Available Snippets

Require (ES5) / Import (ES6)

Keyword Snippet
requireExpect const expect = require('expect');
importExpect import expect from 'expect';

Assertions

Each assertion comes in two forms.

  1. The full expect().toExist();
  2. Just the assertion function toExist();

The full assetion keywords start with expect followed by the function name: expectToExist

Tip: If you press TAB when using a snippet it will place the cursor in the next brackets.

The short hand is just the function name as a whole: toExist

Keyword Snippet
toExist toExist();
toNotExist toNotExist();
toBe toBe();
toNotBe toNotBe();
toEqual toEqual();
toNotEqual toNotEqual();
toThrow toThrow();
toNotThrow toNotThrow();
toBeA toBeA();
toNotBeA toNotBeA();
toMatch toMatch();
toNotMatch toNotMatch();
toBeLessThan toBeLessThan();
toBeLessThanOrEqualTo toBeLessThanOrEqualTo();
toBeGreaterThan toBeGreaterThan();
toBeLessThanOrEqualTo toBeLessThanOrEqualTo();
toInclude toInclude();
toExclude toExclude();
toIncludeKey toIncludeKey();
toIncludeKeys toIncludeKeys();
toExcludeKey toExcludeKey();
toExcludeKeys toExcludeKeys();
toHaveBeenCalled toHaveBeenCalled();
toHaveBeenNotCalled toHaveBeenNotCalled();
toHaveBeenCalledWith toHaveBeenCalledWith();