TestingConfig.fromJson constructor
Creates a TestingConfig instance from a JSON map.
This factory constructor parses a JSON map and creates a corresponding TestingConfig object. It expects the JSON map to contain the keys 'testingFramework', 'enableUnitTests', 'enableIntegrationTests', 'enableE2ETests', 'runUnitTests', and 'coverageThreshold'.
Example JSON:
{
"testingFramework": "flutter_test",
"enableUnitTests": true,
"enableIntegrationTests": false,
"enableE2ETests": true,
"runUnitTests": true,
"coverageThreshold": 80
}
Throws a TypeError if the provided JSON values are not of the expected types.
Implementation
factory TestingConfig.fromJson(Map<String, dynamic> json) {
return TestingConfig(
testingFramework: json['testingFramework'] as String,
enableUnitTests: json['enableUnitTests'] as bool,
enableIntegrationTests: json['enableIntegrationTests'] as bool,
enableE2ETests: json['enableE2ETests'] as bool,
runUnitTests: json['runUnitTests'] as bool,
coverageThreshold: json['coverageThreshold'] as int,
);
}