JSFile jsPsiFile = (JSFile) psiFile;
TestFileStructurePack pack = TestFileStructureManager.fetchTestFileStructurePackByJsFile(jsPsiFile);
if (pack != null) {
List<String> testCases = pack.getTopLevelElements();
if (testCases.isEmpty()) {
throw new ExecutionException("No tests found in " + jsPsiFile.getName());
}
Map<String, Set<String>> scope = ContainerUtil.newHashMap();
for (String testCase : testCases) {
scope.put(testCase, Collections.<String>emptySet());
}
return TestFileScope.customScope(scope);
}
}
}
}
throw new ExecutionException("Unable to extract tests from " + jsFile.getName());
}
if (testType == TestType.TEST_CASE) {
Map<String, Set<String>> scope = Collections.singletonMap(settings.getTestCaseName(),
Collections.<String>emptySet());
return TestFileScope.customScope(scope);