brokhiv / isep-mutation-levels

Mutation Levels for StrykerJS: "Mutation testing for JavaScript and friends"
https://stryker-mutator.io
Apache License 2.0
0 stars 0 forks source link

Read configuration from the JSON file #10

Open dvcopae opened 1 year ago

dvcopae commented 1 year ago

[H] Xavier must check the mutation level for validity and give appropriate error messages in case the structure is invalid.

Initialize the mutation level class with the values read from the configuration JSON file.

brokhiv commented 1 year ago

The JSON attribute has the following type:

{type: "allow" | "block", mutation_operators: String[]} | String

Example ('Custom 1' from Jan Smits' paper):

"mutation_level": {
  "type": "block",
  "mutation_operators": [
    "BlockStatement",
    "ConditionalExpression===Tofalse",
    "ConditionalExpression===Totrue",
    "EqualityOperator===To!==",
    "ObjectLiteral",
    "Regex",
    "StringLiteralEmpty",
    "StringLiteralFill",
    "UnaryOperator+To-",
    "UnaryOperatorRemove~",
    "UnaryOperator-To+"
  ]
}

Example 2 (assuming "Custom 1" is a preset with the previous definition):

"mutation_level": "Custom 1"