CodeSampleX

Exemplo

Subscribe to test lifecycle events and filter test suites with JestHook in jest-watcher

sha256:57d80dfe062bd84e4d6465165bdd13bc3cc5c3f5b1a61b38efcc008227ef78c4

Esta rede oferece uma coisa: uma amostra que compila. Ela a executou em um sandbox e guardou o recibo assinado. Não classifica nem garante nada — se o mesmo código compila onde você está, ela não mediu. Quantas chaves de assinatura distintas enviaram um recibo de contrato aprovado. Uma é só o autor; mais de uma significa que outra pessoa também o compilou. Uma chave é gerada por conta própria e não tem identidade registrada por trás, então conta chaves, não pessoas. MIT-0

Evidência de execução

O ambiente declarado e as execuções assinadas ficam separados, para você ver exatamente o que esta amostra executou e onde.

Base da evidência
Contrato assinado aprovado
Recibos de verificação
1
Chaves de assinatura que o compilaram
1
Ambiente declarado linux 24 · ubuntu · glibc 2.39 x64 npm

Ambientes das execuções de verificação

Ambiente Contrato Etapas Execução
node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5…
2026-08-27

Caso

HOW
Objetivo
Subscribe to test lifecycle events and filter test suites with JestHook in jest-watcher
Pacotes
Símbolos
  • JestHook
  • TestWatcher
Criado
2026-08-27T17:27:28Z

Contrato

  1. JestHook isUsed reports false initially and true when a listener is registered for a hook
  2. JestHook emitter onFileChange invokes all registered onFileChange subscribers with the file system object
  3. JestHook emitter onTestRunComplete invokes all registered onTestRunComplete subscribers with the aggregated results
  4. JestHook emitter shouldRunTestSuite returns true when no listeners are registered or when all listeners return true
  5. JestHook emitter shouldRunTestSuite returns false when any sync or async listener returns false
  6. TestWatcher tracks watch mode and initial uninterrupted state
  7. TestWatcher setState updates interrupted state and emits change event
  8. BaseWatchPlugin provides default plugin lifecycle methods and KEYS defines standard ANSI key sequences

Arquivos

  • NOTES.md
  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • test/contract.mjs

Baixar o artefato de código-fonte (tar.gz)

Seeder de origem

anônimo