UNPKG

@syntest/javascript

Version:

SynTest JavaScript is a tool for automatically generating test cases for the JavaScript language

52 lines 2.77 kB
"use strict"; /* * Copyright 2020-2023 Delft University of Technology and SynTest contributors * * This file is part of SynTest Framework - SynTest Core. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); const base_language_1 = require("@syntest/base-language"); const module_1 = require("@syntest/module"); const test_1 = require("./commands/test"); const TreeCrossoverPlugin_1 = require("./plugins/crossover/TreeCrossoverPlugin"); const RandomSamplerPlugin_1 = require("./plugins/sampler/RandomSamplerPlugin"); class JavaScriptModule extends base_language_1.TestingToolModule { constructor() { super( // eslint-disable-next-line @typescript-eslint/no-var-requires, unicorn/prefer-module, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access require("../../package.json").name, // eslint-disable-next-line @typescript-eslint/no-var-requires, unicorn/prefer-module, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access require("../../package.json").version); } register(moduleManager, metricManager, storageManager, userInterface, modules) { const name = "javascript"; const labels = ["javascript", "testing"]; const commands = [ (0, test_1.getTestCommand)(name, moduleManager, metricManager, storageManager, userInterface), ]; const additionalOptions = new Map(); const configuration = new base_language_1.Configuration(); for (const [key, value] of Object.entries(configuration.getOptions())) { additionalOptions.set(key, value); } const javascriptTool = new module_1.Tool(name, labels, "A tool for testing javascript projects.", commands, additionalOptions); moduleManager.registerTool(this, javascriptTool); moduleManager.registerPlugin(this, new TreeCrossoverPlugin_1.TreeCrossoverPlugin()); moduleManager.registerPlugin(this, new RandomSamplerPlugin_1.RandomSamplerPlugin()); super.register(moduleManager, metricManager, storageManager, userInterface, modules); } } exports.default = JavaScriptModule; //# sourceMappingURL=JavaScriptModule.js.map