Back to Spacevim

SpaceVim test layer

docs/layers/test.md

2.4.04.3 KB
Original Source

Available Layers >> test

<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc -->

Description

This layers allows to run tests directly in SpaceVim.

Install

To use this configuration layer, add the following snippet to your custom configuration file.

toml
[[layers]]
  name = "test"

Configuration

To set or override any configuration (see supported settings here) you may use the override_config:

toml
[[layers]]
  name = "test"
  [layers.override_config]
    java_runner = "gradletest"
    java_gradletest_executable = "./gradlew test"

The example above is equivalent to adding the following in viml:

viml
let test#java#runner = "gradletest"
let test#java#gradletest#executable = "./gradlew test"

In essence, it replaces _ with # and prepends test# to the keys inside override_config.

To use ultest, set the configuration:

toml
[[layers]]
  name = "test"
  use_ultest = true

Key bindings

Key BindingDescription
SPC k nRun nearest test
SPC k fRun test file
SPC k sRuns the whole test suite (if the current file is a test file, runs that framework's test suite, otherwise determines the test framework from the last run test).
SPC k lRuns the last test
SPC k vVisits the test file from which you last run your tests (useful when you're trying to make a test pass, and you dive deep into application code and close your test buffer to make more space, and once you've made it pass you want to go back to the test file to write more tests)

Additional bindings with ultest

Key BindingDescription
SPC k uJump to summary
SPC k UOpen summary
SPC k kStop nearest
SPC k KStop
SPC k aAttach
SPC k cClear
SPC k dDebug nearest
SPC k DDebug
SPC k jJump to next failed test
SPC k kJump to previous failed test
SPC k oShow output
SPC k OJump to output