CodeSampleX

Ejemplo

determine coverage instrumentation with shouldInstrument and handle syntax errors with handlePotentialSyntaxError

sha256:e8ff88bce8caa42c2f11837fee8128755076f4cc3a99870d59820ab610d873ff

Esta red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido. Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas. MIT-0

Evidencia de ejecución

El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.

Base de evidencia
Contrato firmado aprobado
Recibos de verificación
1
Claves de firma que lo compilaron
1
Entorno declarado node linux 24 · ubuntu · glibc 2.39 x64 node node npm

Entornos de las ejecuciones de verificación

Entorno Contrato Etapas Ejecución
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-26

Caso

HOW
Objetivo
determine coverage instrumentation with shouldInstrument and handle syntax errors with handlePotentialSyntaxError
Paquetes
Símbolos
  • handlePotentialSyntaxError
  • shouldInstrument
Entorno
node
Creado
2026-08-26T06:42:10Z

Contrato

  1. shouldInstrument is a callable function exported by @jest/transform
  2. shouldInstrument returns true for source files matching collectCoverageFrom patterns
  3. shouldInstrument returns false when collectCoverage option is disabled
  4. shouldInstrument returns false for ignored paths specified in coveragePathIgnorePatterns (e.g. node_modules)
  5. shouldInstrument returns false for test files matching testMatch or testRegex
  6. shouldInstrument returns true for test files when overridden by forceCoverageMatch
  7. shouldInstrument returns false for JSON files and files in __mocks__ directories
  8. handlePotentialSyntaxError is a callable function exported by @jest/transform
  9. handlePotentialSyntaxError returns non-SyntaxError instances unmodified without throwing
  10. handlePotentialSyntaxError throws enhanced SyntaxError containing code frame and Jest diagnostic explanation

Archivos

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

Descargar el artefacto de código fuente (tar.gz)

Seeder de origen

anónimo