UNPKG

bit-bin

Version:

<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b

57 lines (42 loc) 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.JestTester = void 0; function _bluebird() { const data = require("bluebird"); _bluebird = function () { return data; }; return data; } function _jest() { const data = require("jest"); _jest = function () { return data; }; return data; } class JestTester { constructor(jestConfig) { this.jestConfig = jestConfig; } test(context) { var _this = this; return (0, _bluebird().coroutine)(function* () { const config = { rootDir: context.rootPath }; // eslint-disable-next-line const jestConfig = require(_this.jestConfig); Object.assign(jestConfig, { testMatch: context.specFiles }); Object.assign(config, jestConfig); // :TODO he we should match results to components and format them accordingly. (e.g. const results = runCLI(...)) yield (0, _jest().runCLI)(config, [_this.jestConfig]); return { total: 50 }; })(); } } exports.JestTester = JestTester;