Skip to content

Commit

Permalink
test: simplify tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinEberhardt committed Dec 13, 2022
1 parent 32880ce commit 63f6e12
Show file tree
Hide file tree
Showing 5 changed files with 1,341 additions and 1,195 deletions.
24 changes: 10 additions & 14 deletions cucumber.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
// cucumber.js

// Retrieve the path to feature paths from cl arguments of cucumber-js
const cliArgs = process.argv.slice(2);
const featurePath = cliArgs[cliArgs.length - 2];
if (!featurePath) {
throw new Error(`You must provide a path to the feature files.`);
}

let common = [
featurePath, // Specify our feature files
"--require-module ts-node/register", // Load TypeScript module
"--require features/support/*.ts", // Load step definitions
].join(" ");
const common = {
paths: ["../openapi-forge/features/*.feature"],
require: ["features/support/*.ts"],
requireModule: ["ts-node/register"],
publishQuiet: true,
};

module.exports = {
default: common,
generators: {
...common,
format: ["message"],
},
};
12 changes: 1 addition & 11 deletions features/support/base.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
// TODO: add type definitions to the generator

// Retrieve the path to generate.js from cl arguments of cucumber-js
const cliArgs = process.argv.slice(2);
const generatePath = cliArgs[cliArgs.length - 1];

if (!generatePath) {
throw new Error(`You must provide a path to generate.js.`);
}

const generate = require(generatePath);
const generate = require("../../../openapi-forge/src/generate");

import { rmSync, existsSync } from "fs";

Expand Down
Loading

0 comments on commit 63f6e12

Please sign in to comment.