A Typescript Mutation Testing program designed to give an indication to the quality of the tests in a project.
-
filePath
string
- The relative file path from this config file to the root of the source file directory.
-
testFilePath
string
- The relative file path from this config file to the root of the test file directory.
-
testFileExtension
string
- The file extension which is on all tests in the project. (e.g. a test file called
HelloWorld.spec.ts
would give the testFileExtension of.spec
- The file extension which is on all tests in the project. (e.g. a test file called
-
mutateAllFiles
boolean
True
: All files found in the filePath root directory will be included. All directories and files from this root will also be recursively included.filesToSkip
will remove selected files from the list.False
: Uses thefilesToMutate
section. IgnoresfilesToSkip
.
-
filesToMutate
Array<string>
- A list of files in the
filePath
directory to be targeted by the mutation tester.
- A list of files in the
-
filesToSkip
Array<string>
- A list of files in the
filePath
directory to be skipped by the mutation tester.
- A list of files in the
-
testRunner
string
- The test runner you are using in your project. Note. Currently only Mocha is supported.
-
runnerConfig
Object
- An object containing the runner configuration for the test runner.
- This is used by the test runner itself so see the configuration for your chosen test runner.
- Mocha Runner Config Options can be found here https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically
- WARNING : Not all of these options have been tested and so may cause issues.
-
outputFormat
Array<string>
- The type of output the algorithm should produce.
- Current options are:
console
: Produces a "Per File" output in the console after analysis.app
: Produces a JSON file for the Professor X - App.
profx.config.ts
export class Config {
public static readonly CONFIG = {
filePath: "./testProject/src/",
testFilePath: "./testProject/src/",
testFileExtension: ".spec",
mutateAllFiles: false,
filesToMutate: ["HelloWorld.ts"],
filesToSkip: ["FileTwo.ts"],
testRunner: "mocha",
runnerConfig: {
reporter: "dot"
},
outputFormat: ["console", "app"]
};
}