Ir al contenido principal
Versión: 6.2 🚧

Extensiones avanzadas

[Traducción Beta No Oficial]

Esta página fue traducida por PageTurner AI (beta). No está respaldada oficialmente por el proyecto. ¿Encontraste un error? Reportar problema →

Esta tabla enumera extensiones más avanzadas que permiten integrarse directamente con el motor para:

  • interceptar pruebas, omitirlas y modificar resultados

  • interceptar specs omitiéndolas si es necesario

  • procesar posteriormente instancias de spec tras su creación

  • modificar el contexto de corrutinas usado en especificaciones y pruebas

  • aplicar lógica personalizada de creación de instancias

  • filtrar especificaciones y pruebas

  • ajustar la salida de pruebas

y así sucesivamente

ExtensionDescription
ConstructorExtensionProvides custom logic to instantiate spec classes. An example is the Spring extension constructor extension which autowire's Spring beans.
TestCaseExtensionIntercepts calls to a test, can skip a test, override the test result, and modify the coroutine context.
SpecExtensionIntercepts calls to a spec, can skip a spec, and modify the coroutine context.
SpecRefExtensionIntercepts calls to a spec before it is instantiated. Can skip instantiation.
DisplayNameFormatterExtensionCan customize the display names of tests used in test output.
EnabledExtensionCan provide custom logic to determine if a test is enabled or disabled.
ProjectExtensionIntercepts calls to the test engine before a project starts.
SpecExecutionOrderExtensionCan sort specs before execution begins to provide a custom spec execution order.
TagExtensionCan provide active tags from arbitrary sources.
InstantiationErrorListenerIs notified when a spec fails to be instantiated due to some exception.
InstantiationListenerIs notified when a spec is successfully instantiated.
PostInstantiationExtensionIntercepts specs when they are instantiated, can replace the spec instance and modify coroutine context.
IgnoredSpecListenerIs notified when a spec is skipped.
IgnoredTestListenerIs notified when a test is skipped.