@syntest/javascript
Version:
SynTest JavaScript is a tool for automatically generating test cases for the JavaScript language
121 lines • 4.06 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTestCommand = void 0;
const module_1 = require("@syntest/module");
const JavaScriptLauncher_1 = require("../JavaScriptLauncher");
function getTestCommand(tool, moduleManager, metricManager, storageManager, userInterface) {
const options = new Map();
const commandGroup = "Type Inference Options:";
const samplingGroup = "Sampling Options:";
const executorGroup = "Test Execution Options:";
options.set("incorporate-execution-information", {
alias: [],
default: true,
description: "Incorporate execution information.",
group: commandGroup,
hidden: false,
type: "boolean",
});
options.set("type-inference-mode", {
alias: [],
default: "proportional",
description: "The type inference mode: [proportional, ranked, none].",
group: commandGroup,
hidden: false,
type: "string",
});
options.set("random-type-probability", {
alias: [],
default: 0.1,
description: "The probability we use a random type regardless of the inferred type.",
group: commandGroup,
hidden: false,
type: "number",
});
options.set("constant-pool", {
alias: [],
default: true,
description: "Enable constant pool.",
group: samplingGroup,
hidden: false,
type: "boolean",
});
options.set("constant-pool-probability", {
alias: [],
default: 0.5,
description: "Probability to sample from the constant pool instead creating random values",
group: samplingGroup,
hidden: false,
type: "number",
});
options.set("type-pool", {
alias: [],
default: true,
description: "Enable type pool.",
group: samplingGroup,
hidden: false,
type: "boolean",
});
options.set("type-pool-probability", {
alias: [],
default: 0.5,
description: "Probability to sample from the type pool instead creating random values",
group: samplingGroup,
hidden: false,
type: "number",
});
options.set("statement-pool", {
alias: [],
default: true,
description: "Enable statement pool.",
group: samplingGroup,
hidden: false,
type: "boolean",
});
options.set("statement-pool-probability", {
alias: [],
default: 0.8,
description: "Probability to sample from the statement pool instead creating new values",
group: samplingGroup,
hidden: false,
type: "number",
});
options.set("execution-timeout", {
alias: [],
default: 2000,
description: "The timeout for one execution of one test (must be larger than the test-timeout).",
group: executorGroup,
hidden: false,
type: "number",
});
options.set("test-timeout", {
alias: [],
default: 1000,
description: "The timeout for one test.",
group: executorGroup,
hidden: false,
type: "number",
});
options.set("syntax-forgiving", {
alias: [],
default: true,
description: "Whether we allow 'odd' syntax or throw an error.",
group: "Debugging",
hidden: false,
type: "boolean",
});
options.set("silence-test-output", {
alias: [],
default: true,
description: "Whether we show the test output in the logs.",
group: "Debugging",
hidden: false,
type: "boolean",
});
return new module_1.Command(moduleManager, tool, "test", "Run the test case generation tool on a certain JavaScript project.", options, async (arguments_) => {
const launcher = new JavaScriptLauncher_1.JavaScriptLauncher(arguments_, moduleManager, metricManager, storageManager, userInterface);
await launcher.run();
});
}
exports.getTestCommand = getTestCommand;
//# sourceMappingURL=test.js.map