test-snapshot-typescript should work with typescript 6
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 122k
- Forks
- 37.4k
- Ø Merge
- 4 T. 3 Std.
- Gemergte PRs (30 T.)
- 272
Beschreibung
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'
}
});
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit test/fixtures/snapshot/typescript-main.js und test/fixtures/snapshot/typescript.js und führe dann den Snapshot-Test unter Verwendung des im Issue beschriebenen TypeScript-6-Bundles oder der Debian-Paketdateien aus. Prüfe die Compiler-Optionen und die erwartete Snapshot-Ausgabe; abgeschlossen ist die Aufgabe, wenn der Test ohne den AssertionError unter TypeScript 6 durchläuft.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, typescript
- Bereich
- testing-qa
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Ruhig
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 72/100