1.0.0-beta.5 • Published 6 years ago

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

Weekly downloads
7
License
MIT
Repository
github
Last release
6 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

6 years ago

1.0.0-beta.4

6 years ago

1.0.0-beta.3

6 years ago

1.0.0-beta.2

6 years ago

1.0.0-beta.1

6 years ago

1.0.0-alpha020

6 years ago

1.0.0-alpha019

6 years ago

1.0.0-alpha018

6 years ago

1.0.0-alpha017

6 years ago

1.0.0-alpha016

6 years ago

1.0.0-alpha015

6 years ago

1.0.0-alpha014

6 years ago

1.0.0-alpha013

6 years ago

1.0.0-alpha012

6 years ago

1.0.0-alpha011

6 years ago

1.0.0-alpha010

6 years ago

1.0.0-alpha009

6 years ago

1.0.0-alpha008

6 years ago

1.0.0-alpha007

6 years ago

1.0.0-alpha006

6 years ago

1.0.0-alpha005

6 years ago

1.0.0-alpha004

6 years ago

1.0.0-alpha003

6 years ago

1.0.0-alpha002

6 years ago

1.0.0-alpha001

6 years ago