test-snapshot-typescript should work with typescript 6
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 122k
- Fork
- 37.3k
- Merge medio
- 4g 2h
- PR unite (30g)
- 283
Descrizione
Version
24.15.0
Platform
Linux lal 7.0.7+deb14-amd64 #1 SMP PREEMPT_DYNAMIC Debian 7.0.7-1 (2026-05-15) x86_64 GNU/Linux
Subsystem
test
What steps will reproduce the bug?
Replace test/fixtures/snapshot/typescript.js by typescript 6 bundle.
How often does it reproduce? Is there a required condition?
As a distributor, we avoid bundled software when not strictly necessary.
test/fixtures/snapshot/typescript.js
is such a thing. Instead, I use a copy of the node-typescript debian package files, setup before the tests.
What is the expected behavior? Why is that the expected behavior?
No test error.
What do you see instead?
105s AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
105s + actual - expected
105s
105s + '"use strict";\n' +
105s + 'class VirtualPoint {\n' +
105s + ' x;\n' +
105s + ' y;\n' +
105s + ' constructor(x, y) {\n' +
105s - 'var VirtualPoint = /** @class */ (function () {\n' +
105s - ' function VirtualPoint(x, y) {\n' +
105s ' this.x = x;\n' +
105s ' this.y = y;\n' +
105s ' }\n' +
105s + '}\n' +
105s + 'const newVPoint = new VirtualPoint(13, 56);\n'
105s - ' return VirtualPoint;\n' +
105s - '}());\n' +
105s - 'var newVPoint = new VirtualPoint(13, 56);\n'
Additional information
Something like this could help
--- a/test/fixtures/snapshot/typescript-main.js
+++ b/test/fixtures/snapshot/typescript-main.js
@@ -20,7 +20,10 @@
source,
{
compilerOptions: {
- module: ts.ModuleKind.CommonJS
+ module: ts.ModuleKind.CommonJS,
+ strict: false,
+ alwaysStrict: false,
+ target: 'es5'
}
});
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con test/fixtures/snapshot/typescript-main.js e test/fixtures/snapshot/typescript.js, quindi esegui il test di snapshot usando il bundle TypeScript 6 o i file del pacchetto Debian descritti nell’issue. Controlla le opzioni del compilatore e l’output di snapshot previsto; il lavoro è completato quando il test termina senza l’AssertionError con TypeScript 6.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, typescript
- Ambito
- testing-qa
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Tranquilla
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 72/100