Proposal: change default snapshot filename (~breaking)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- node.js
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- 没有语言数据
- 星标
- 3
- 派生
- 4
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nodejs/test-runner 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 1/100
nodejs/test-runner#46 ·
-
难度 1/5 1 小时以内 新手友好度 5/100
nodejs/test-runner#45 ·
-
难度 1/5 1 小时以内 新手友好度 10/100
nodejs/test-runner#44 ·
-
难度 1/5 1 小时以内 新手友好度 15/100
nodejs/test-runner#43 ·
-
难度 1/5 1 小时以内 新手友好度 15/100
nodejs/test-runner#42 ·
查看 nodejs/test-runner 的全部 Issue
相似的 Issue
-
bug ready-for-dev
难度 1/5 1-3 小时 新手友好度 92/100
OpenHands/extensions#897 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
elecnix/pi-claude-memory#22 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
Facepunch/sbox-public#12284 ·
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 87/100
antfu-collective/ni#376 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/vscode-pull-request-github#9159 ·
维护者通常 1 天内回复