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 |
|
3 | This 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
|
6 | import { Spec } from '@hayspec/spec';
|
7 | import { Runner } from '@hayspec/runner';
|
8 |
|
9 | const runner = new Runner();
|
10 | runner.require('./foo/**/*.test.js', '!./foo/**/foo.test.js');
|
11 | runner.require('./bar/*.hay.js');
|
12 |
|
13 | const spec = new Spec();
|
14 | runner.specs.forEach((folder, spec) => {
|
15 | spec.spec(filder, spec);
|
16 | });
|
17 | spec.perform();
|
18 | ```
|