Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

add module export to allow other services to consume results of test runs #136

Open
larrybotha opened this issue Feb 28, 2019 · 0 comments

Comments

@larrybotha
Copy link

larrybotha commented Feb 28, 2019

It'd be great to be able to consume the results of tests, as Postman's Newman CLI tool allows.

Jest allows for custom test runners to be configured; one doesn't need to use Jest's methods to run tests, but one can still benefit from Jest's other features.

e.g. there is a Mocha runner for Jest, as well as an ESLint runner.

By allowing for a custom Jest runner to consume results of tests we get the following from Jest:

  • watching files for changes to run tests
  • running specific tests via Jest's CLI
  • running projects simultaneously (e.g. API tests, unit tests, integration tests)
  • running specific tests using typeahead
  • running specific projects using jest-watch-select-projects

Describe the solution you'd like

A module that passes the results of a test run to a callback.

Example:

// my-api-endpoint-1.test.js
const strest = require('strest')

const strestConfig = {
	// references to yaml files and configs for this test
};

strest.run(strestConfig, (err, result) => {
	// handle err / result of test run
});

Additional context

For reference on what can be done with Jest...

Jest Mocha runner:
Gif of jest-runner-mocha


Watch typeahead:
Gif of jest-watch-typeahead


Watch select projects:
Gif of jest-watch-select-projects

@larrybotha larrybotha changed the title add module export to allow other services from consuming results of test runs add module export to allow other services to consume results of test runs Feb 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant