mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Recognise imports of well-known testing frameworks.
This commit is contained in:
@@ -67,4 +67,19 @@ module TestFile {
|
||||
private class FileContainingTestCases extends Range {
|
||||
FileContainingTestCases() { this = any(TestCase tc).getFile() }
|
||||
}
|
||||
|
||||
/** A file that imports a well-known testing framework. */
|
||||
private class FileImportingTestingFramework extends Range {
|
||||
FileImportingTestingFramework() {
|
||||
exists(string pkg, ImportSpec is |
|
||||
is.getPath() = pkg and
|
||||
is.getFile() = this
|
||||
|
|
||||
pkg = "net/http/httptest" or
|
||||
pkg = "gen/thrifttest" or
|
||||
pkg = "github.com/onsi/ginkgo" or
|
||||
pkg = "github.com/onsi/gomega"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user