Proposal: change default snapshot filename (~breaking)

Abierto
#26 1 comentario 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
52/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
node.js

Línea de trabajo

Read the snapshot implementation linked as nodejs-loaders/…/test/snapshots.mjs and trace how the default filename is generated and existing files are read. The change is complete when new snapshots use the .snap.cjs name and the proposed handling of old .snapshot files is covered without breaking existing tests.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Problem(s) to solve

The current default value of a snapshot filename is to append .snapshot to the name of generating file (aka a "test file"). For instance foo.test.js → foo.test.js.snapshot.

This breaks any IDE trying to help with the file.

A snapshot file is actually a CJS file.

Proposed solution(s)

Adjust the default filename to ${TEST_FILE_BASENAME}.snap.cjs (see nodejs-loaders/…/test/snapshots.ts).

Ex foo.test.js → foo.test.snap.cjs

IDEs recognise this and render the snapshot file as the CJS that it actually is.


We can mitigate a breaking change by detecting the old on read and renaming the file on disk whilst also outputting a message to the console.

Lenguaje dominante
Sin datos de lenguaje
Estrellas
3
Forks
4
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nodejs/test-runner

Todos los issues de nodejs/test-runner

Issues similares

Más issues de DevTools

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.