0.1.14 • Published 4 years ago

luxon-jest-matchers v0.1.14

Weekly downloads
7
License
Unlicense
Repository
github
Last release
4 years ago

luxon-jest-matchers

Build Status

This library aims to provide custom assertions for Luxon with Jest runner

Installation

yarn add --dev luxon-jest-matchers

Setup

Jest

In your jest.config.js :

setupFilesAfterEnv: ['luxon-jest-matchers']

Typescript

You can add this at the beginning of your tests or in a definition file (.d.ts) you include in your tsconfig.json :

import 'luxon-jest-matchers';

Available matchers

DateTime

  • toEqualDateTime(date: DateTime)
  • toBeStrictlyBeforeDateTime(date: DateTime)
  • toBeBeforeDateTime(date: DateTime)
  • toBeStrictlyAfterDateTime(date: DateTime)
  • toBeAfterDateTime(date: DateTime)
  • toBeValidDateTime()
  • toBeSameDateAs(date: DateTime)

Duration

  • toEqualDuration(duration: Duration)
  • toEqualDurationAs(duration: Duration, unit: DurationUnit)
  • toBeValidDuration()

Interval

  • toEqualInterval(interval: Interval)
  • toEngulfInterval(interval: Interval)
  • toContainDateTime(date: DateTime)
  • toBeValidInterval()
0.1.14

4 years ago

0.1.13

4 years ago

0.1.12

4 years ago

0.1.11

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.4

4 years ago

0.1.5

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.3

4 years ago

0.1.0

4 years ago