CodeQL library for JavaScript/TypeScript
codeql/javascript-all 2.2.1-dev (changelog, source)
Search

Module Make::MergeTests

A module that merges two test signatures.

This module can be used when multiple inline expectation tests occur in a single file. For example:

module Test1 implements TestSig {
 ...
}

module Test2 implements TestSig {
  ...
}

import MakeTest<MergeTests<Test1, Test2>>

Import path

import codeql.util.test.InlineExpectationsTest

Predicates

getARelevantTag

Returns all tags that can be generated by this test. Most tests will only ever produce a single tag. Any expected result comments for a tag that is not returned by the getARelevantTag() predicate for an active test will be ignored. This makes it possible to write multiple tests in different .ql files that all query the same source code.

hasActualResult

Returns the actual results of the query that is being tested. Each result consist of the following values: - location - The source code location of the result. Any expected result comment must appear on the start line of this location. - element - Display text for the element on which the result is reported. - tag - The tag that marks this result as coming from this test. This must be one of the tags returned by getARelevantTag(). - value - The value of the result, which will be matched against the value associated with tag in any expected result comment on that line.

hasOptionalResult

Holds if there is an optional result on the specified location.

Parameters

TestImpl1TestSig
TestImpl2TestSig