2.4.2 • Published 23 days ago

@times-components/test-utils v2.4.2

Weekly downloads
286
License
BSD-3-Clause
Repository
github
Last release
23 days ago

Test Utils

A suite of helper methods that assist with testing across the packages of Times Components

How to use

iterator

The iterator method iterates over a given array of test objects and runs the tests after prefixing the test names with an index. This ensures a correct ordering of tests, particularly snapshot tests, which allows for a better code diff. Snapshot tests should come first in the list, followed by any other tests to ensure the numbered test names increment as expected. Where appropriate, snapshot tests would be separated out from non-snapshot tests.

Example:

import { iterator } from "@times-components/test-utils";

const tests = [
  {
    name: "test one",
    test: () => {
      // do stuff with snapshots
    }
  },
  {
    name: "test two",
    test: () => {
      // do stuff with snapshots
    }
  }
];

iterator(tests);

Translates to:

it("1. test one", () => {
  // do stuff with snapshots
});

it("2. test two", () => {
  // do stuff with snapshots
});

Contributing

Please read CONTRIBUTING.md before contributing to this package

2.4.2

23 days ago

2.4.2-alpha.800

1 month ago

2.4.1

1 year ago

2.4.0

2 years ago

2.3.11

2 years ago

2.3.10

2 years ago

2.3.9

3 years ago

2.3.8

5 years ago

2.3.7

5 years ago

2.3.6

5 years ago

2.3.5

5 years ago

2.3.4

5 years ago

2.3.3

5 years ago

2.3.2

5 years ago

2.3.1

5 years ago

2.3.0

5 years ago

2.2.44

5 years ago

2.2.43

5 years ago

2.2.42

5 years ago

2.2.41

5 years ago

2.2.40

5 years ago

2.2.39

5 years ago

2.2.38

5 years ago

2.2.37

5 years ago

2.2.36

5 years ago

2.2.35

5 years ago

2.2.34

5 years ago

2.2.31

5 years ago

2.2.30

5 years ago

2.2.29

5 years ago

2.2.28

5 years ago

2.2.27

5 years ago

2.2.26

5 years ago

2.2.25

5 years ago

2.2.24

5 years ago

2.2.23

5 years ago

2.2.22

5 years ago

2.2.21

5 years ago

2.2.20

5 years ago

2.2.19

5 years ago

2.2.18

5 years ago

2.2.17

5 years ago

2.2.16

5 years ago

2.2.15

5 years ago

2.2.14

5 years ago

2.2.13

5 years ago

2.2.12

5 years ago

2.2.11

5 years ago

2.2.10

5 years ago

2.2.9

5 years ago

2.2.8

5 years ago

2.2.7

5 years ago

2.2.6

5 years ago

2.2.5

5 years ago

2.2.4

5 years ago

2.2.3

5 years ago

2.2.2

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.16

5 years ago

2.1.15

5 years ago

2.1.14

5 years ago

2.1.13

5 years ago

2.1.12

5 years ago

2.1.11

5 years ago

2.1.9

5 years ago

2.1.8

5 years ago

2.1.6

5 years ago

2.1.5

5 years ago

2.1.4

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago