A TestRun represents an in-progress or completed test run and provides methods to report the state of individual tests in the run.
A TestRun represents an in-progress or completed test run and provides methods to report the state of individual tests in the run.
(add-coverage test-run file-coverage)
Adds coverage for a file in the run.
Parameters:
file-coverage
: FileCoverage
Returns: void
Adds coverage for a file in the run. **Parameters:** - `file-coverage`: `FileCoverage` **Returns:** `void`
(append-output test-run output)
(append-output test-run output location)
(append-output test-run output location test)
Appends raw output from the test runner. On the user's request, the
output will be displayed in a terminal. ANSI escape sequences,
such as colors and text styles, are supported. New lines must be given
as CRLF (\r\n
) rather than LF (\n
).
Parameters:
output
: string
- Output text to append.location
: Location | undefined
- Indicate that the output was logged at the given
location.test
: TestItem | undefined
- Test item to associate the output with.Returns: void
Appends raw output from the test runner. On the user's request, the output will be displayed in a terminal. ANSI escape sequences, such as colors and text styles, are supported. New lines must be given as CRLF (`\r\n`) rather than LF (`\n`). **Parameters:** - `output`: `string` - Output text to append. - `location`: `Location | undefined` - Indicate that the output was logged at the given location. - `test`: `TestItem | undefined` - Test item to associate the output with. **Returns:** `void`
(end test-run)
Signals the end of the test run. Any tests included in the run whose states have not been updated will have their state reset.
Returns: void
Signals the end of the test run. Any tests included in the run whose states have not been updated will have their state reset. **Returns:** `void`
(enqueued test-run test)
Indicates a test is queued for later execution.
Parameters:
test
: TestItem
- Test item to update.Returns: void
Indicates a test is queued for later execution. **Parameters:** - `test`: `TestItem` - Test item to update. **Returns:** `void`
(errored test-run test message)
(errored test-run test message duration)
Indicates a test has errored. You should pass one or more {@link TestMessage TestMessages} to describe the failure. This differs from the "failed" state in that it indicates a test that couldn't be executed at all, from a compilation error for example.
Parameters:
test
: TestItem
- Test item to update.message
: TestMessage | readonly TestMessage[]
- Messages associated with the test failure.duration
: number | undefined
- How long the test took to execute, in milliseconds.Returns: void
Indicates a test has errored. You should pass one or more {@link TestMessage TestMessages} to describe the failure. This differs from the "failed" state in that it indicates a test that couldn't be executed at all, from a compilation error for example. **Parameters:** - `test`: `TestItem` - Test item to update. - `message`: `TestMessage | readonly TestMessage[]` - Messages associated with the test failure. - `duration`: `number | undefined` - How long the test took to execute, in milliseconds. **Returns:** `void`
(failed test-run test message)
(failed test-run test message duration)
Indicates a test has failed. You should pass one or more {@link TestMessage TestMessages} to describe the failure.
Parameters:
test
: TestItem
- Test item to update.message
: TestMessage | readonly TestMessage[]
- Messages associated with the test failure.duration
: number | undefined
- How long the test took to execute, in milliseconds.Returns: void
Indicates a test has failed. You should pass one or more {@link TestMessage TestMessages} to describe the failure. **Parameters:** - `test`: `TestItem` - Test item to update. - `message`: `TestMessage | readonly TestMessage[]` - Messages associated with the test failure. - `duration`: `number | undefined` - How long the test took to execute, in milliseconds. **Returns:** `void`
(name test-run)
The human-readable name of the run. This can be used to disambiguate multiple sets of results in a test run. It is useful if tests are run across multiple platforms, for example.
The human-readable name of the run. This can be used to disambiguate multiple sets of results in a test run. It is useful if tests are run across multiple platforms, for example.
(on-did-dispose test-run)
(on-did-dispose test-run listener)
(on-did-dispose test-run listener this-args)
(on-did-dispose test-run listener this-args disposables)
An event fired when the editor is no longer interested in data associated with the test run.
Parameters:
listener
: (e: T) => any
- The listener function will be called when the event happens.this-args
: any
- The this
-argument which will be used when calling the event listener.disposables
: Disposable[] | undefined
- An array to which a {@link Disposable } will be added.Returns: Disposable
- A disposable which unsubscribes the event listener.
An event fired when the editor is no longer interested in data associated with the test run. **Parameters:** - `listener`: `(e: T) => any` - The listener function will be called when the event happens. - `this-args`: `any` - The `this`-argument which will be used when calling the event listener. - `disposables`: `Disposable[] | undefined` - An array to which a {@link Disposable } will be added. **Returns:** `Disposable` - A disposable which unsubscribes the event listener.
(passed test-run test)
(passed test-run test duration)
Indicates a test has passed.
Parameters:
test
: TestItem
- Test item to update.duration
: number | undefined
- How long the test took to execute, in milliseconds.Returns: void
Indicates a test has passed. **Parameters:** - `test`: `TestItem` - Test item to update. - `duration`: `number | undefined` - How long the test took to execute, in milliseconds. **Returns:** `void`
(persisted? test-run)
Whether the test run will be persisted across reloads by the editor.
Whether the test run will be persisted across reloads by the editor.
(set-on-did-dispose! test-run value)
An event fired when the editor is no longer interested in data associated with the test run.
An event fired when the editor is no longer interested in data associated with the test run.
(skipped test-run test)
Indicates a test has been skipped.
Parameters:
test
: TestItem
- Test item to update.Returns: void
Indicates a test has been skipped. **Parameters:** - `test`: `TestItem` - Test item to update. **Returns:** `void`
(started test-run test)
Indicates a test has started running.
Parameters:
test
: TestItem
- Test item to update.Returns: void
Indicates a test has started running. **Parameters:** - `test`: `TestItem` - Test item to update. **Returns:** `void`
(token test-run)
A cancellation token which will be triggered when the test run is canceled from the UI.
A cancellation token which will be triggered when the test run is canceled from the UI.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close