1.0.0-beta.5 • Published 7 years ago

alsatian-fluent-assertions v1.0.0-beta.5

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

MIT License npm version Build Status Windows Build status dependencies Status devDependencies Status codecov Maintainability Known Vulnerabilities PRs Welcome Code of Conduct

Alsatian fluent assertions plugin

This is a fluent assertions plugin for the Alsatian xUnit framework, for JavaScript and TypeScript. It provides a way to chain assertions while narrowing the scope, enabling the clear and concise expression of code specifications for those who prefer a fluent style. By contrast, the default expectations framework in Alsatian is not currently fluent.

Assert(obj)
  .is(UserModel)
  .has(o => o.name)
  .that.hasMatch(/\d+/) // alt 'matches' that returns match result scope
  .that.converted(parts => +parts[0])
  .equals(7);

Assert(obj).equals(expected);

Assert(obj)
  .hasAsserts({ // same as .has/.hasProperties with MatchMode.Asserts
    name: "agent 007",
    address: a => a.is(Redacted),
    phone: /\+44\d{10}/,
    deploy: a => a.is(Function).not.throws()
  });

Basic Usage & Documentation

Please visit our wiki.

Installation

If you already have Alsatian installed, just save this with your devDependencies.

npm i -sD alsatian-fluent-assertions
1.0.0-beta.5

7 years ago

1.0.0-beta.4

7 years ago

1.0.0-beta.3

7 years ago

1.0.0-beta.2

7 years ago

1.0.0-beta.1

7 years ago

1.0.0-alpha020

7 years ago

1.0.0-alpha019

7 years ago

1.0.0-alpha018

7 years ago

1.0.0-alpha017

7 years ago

1.0.0-alpha016

7 years ago

1.0.0-alpha015

7 years ago

1.0.0-alpha014

7 years ago

1.0.0-alpha013

7 years ago

1.0.0-alpha012

7 years ago

1.0.0-alpha011

7 years ago

1.0.0-alpha010

7 years ago

1.0.0-alpha009

7 years ago

1.0.0-alpha008

7 years ago

1.0.0-alpha007

7 years ago

1.0.0-alpha006

7 years ago

1.0.0-alpha005

7 years ago

1.0.0-alpha004

7 years ago

1.0.0-alpha003

7 years ago

1.0.0-alpha002

7 years ago

1.0.0-alpha001

7 years ago