UNPKG

704 BMarkdownView Raw
1![Build Status](https://travis-ci.org/hayspec/framework.svg?branch=master) [![NPM Version](https://badge.fury.io/js/@hayspec%2Frunner.svg)](https://badge.fury.io/js/%40hayspec%2Frunner)
2
3This package provides the logic for discovering and performing test files. It's included in the Hayspec CLI, but you can use it to run tests directly from your NodeJS application.
4
5```ts
6import { Spec } from '@hayspec/spec';
7import { Runner } from '@hayspec/runner';
8
9const runner = new Runner();
10runner.require('./foo/**/*.test.js', '!./foo/**/foo.test.js');
11runner.require('./bar/*.hay.js');
12
13const spec = new Spec();
14runner.specs.forEach((folder, spec) => {
15 spec.spec(filder, spec);
16});
17spec.perform();
18```