Skip to content

Programmatic API #83

@sindresorhus

Description

@sindresorhus

So other tools can use it without having to spawn. Right now I spawn in gulp-ava.

This would also help us have a better separation between the CLI and the API.

The API should be high-level and do whatever the CLI does now, like forking, etc. The CLI would just be a super-thin wrapper calling the API.

const Ava = require('ava').Ava;

const instance = new Ava({
  files: ['foo.js', 'test/**'],
  failFast: true
});

instance.run();

instance.log().pipe(process.stdout);

The above is just a quick example. I hope it will end up looking better than that.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions