Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

covertable

walkframe3.8kApache-2.02.5.2TypeScript support: included

A flexible pairwise tool written in TypeScript

allpair, all-pair, allpairs, all-pairs, pairwise, N-wise, 2-wise, 3-wise, two-wise, three-wise, N-term, 2-term, 3-term, two-term, three-term, pairs, pair, combinatorial, covering-array, covering-arrays, pict

readme

npm version Workflow codecov github

What is covertable?

covertable is a powerful tool for generating pairwise combinations of input factors, designed for both Node.js and browser environments. It's easy to use, flexible, and supports advanced filtering options, making it perfect for testing scenarios and generating comprehensive datasets.

Simple usage

import { make } from "covertable";
const machine = ["iPhone", "Pixel", "XPERIA", "ZenFone", "Galaxy"];
const os = ["iOS", "Android"];
const browser = ["FireFox", "Chrome", "Safari"];
make([machine, os, browser]);
[
  [ 'Pixel', 'iOS', 'Chrome' ],
  [ 'ZenFone', 'iOS', 'FireFox' ],
  [ 'Pixel', 'Android', 'Safari' ],
  [ 'Galaxy', 'Android', 'Chrome' ],
  [ 'XPERIA', 'Android', 'FireFox' ],
  [ 'Pixel', 'iOS', 'FireFox' ],
  [ 'iPhone', 'iOS', 'Safari' ],
  [ 'Galaxy', 'iOS', 'Safari' ],
  [ 'XPERIA', 'iOS', 'Chrome' ],
  [ 'ZenFone', 'Android', 'Chrome' ],
  [ 'Galaxy', 'iOS', 'FireFox' ],
  [ 'iPhone', 'Android', 'Chrome' ],
  [ 'iPhone', 'iOS', 'FireFox' ],
  [ 'ZenFone', 'iOS', 'Safari' ],
  [ 'XPERIA', 'iOS', 'Safari' ]
]

Advanced usage

Advanced usage is here

changelog

History

2.4.x

  • Fixed an issue where preFilter was evaluating and excluding incomplete elements. This is a minor upgrade due to the large scope of the impact.
  • Type names are now unified with the Type suffix.

2.3.x

  • PictConstraintsLexer was added. (#37)
    • It is a lexer designed to parse PICT constraints.
    • It parses constraints written in the PICT format, enabling the evaluation of complex conditions.
    • The parsed constraints are then used in the make function to dynamically filter the generated combinations based on the specified rules.

2.2.x

  • Speed is increased by expressing combinations of elements as a product of prime numbers.
  • Added SuggestRowType to infer the row type.

2.1.x

  • Speed up processing speed by pre-sorting target pairs.
  • Added makeAsync function to generate combinations sequentially.

2.0.x

  • The sorter option was split into sorter and criterion.
    • e.g., greedy -> hash sorter + greedy criterion.
  • The greedy method is much faster than before.
  • The greedy method now includes a tolerance option to balance speed and results.
  • The sequential sorter was dropped.
    • Due to the potential for huge numbers of combinations in TypeScript.

1.1.x

  • The greedy sorter was improved in both implementations.
    • Speed has been increased.

1.0.x

  • First release 🎉