in testData.js [64:79]
static async getTestData(query) {
var testURL = query.url;
if (testURL) {
var response = await HTTP.getJSON(testURL);
return new TestData(response, query);
} else if (query.path) {
const fullTestPath = path.join(config.testsDir, query.path).normalize();
if (!(await exists(fullTestPath)) || !fullTestPath.startsWith(config.testsDir)) {
throw new Error("Test file invalid or not exists.");
}
const content = await readFile(fullTestPath);
return new TestData(JSON.parse(content), query);
} else {
throw new Error("A 'url' or 'path' parameters should be included on the query string.");
}
}