UNPKG

jest-bdd-generator

Version:

Jest code generator empowered with Gherkin and BDD

29 lines (28 loc) 858 B
import * as fs from "fs"; import * as path from "path"; import { JestToGherkin } from "./JestToGherkin"; export * from "./JestToGherkin"; function createTranspiler(pathTestsInput) { const source = fs.readFileSync(pathTestsInput).toString(); const transpiler = new JestToGherkin(); transpiler.fileName = path.basename(pathTestsInput); const _o = transpiler.transpile(source, { fileName: pathTestsInput }).outputText; return transpiler; } function compose(options) { const { pathTestsInput } = options; const transpiler = createTranspiler(pathTestsInput); return transpiler.outputCode(); } function generateComments(options) { const { pathTestsInput } = options; const transpiler = createTranspiler(pathTestsInput); return transpiler.generateComments(); } export { compose, generateComments }; //# sourceMappingURL=index.js.map