datafire
Version:
[![Travis][travis-image]][travis-link] [![Downloads][downloads-image]][npm-link] [![NPM version][npm-image]][npm-link] [](https://www.npmjs.com/package/datafire) <!--[![Dependency status][deps-i
22 lines (18 loc) • 604 B
JavaScript
const path = require('path');
const fs = require('fs');
const YAML = require('yamljs');
const logger = require('../util/logger');
const datafire = require('../');
const run = require('./run');
const JSON_FILE_REGEX = /\.json$/;
module.exports = function(args) {
let project = datafire.Project.main();
let test = project.tests[args.test];
if (!test) throw new Error("Test " + args.test + " not found")
let action = datafire.Action.fromName(test.action, process.cwd());
return run(Object.assign({}, args, {
action: test.action,
input: test.input,
accounts: test.accounts,
}));
}