Skip to content

test-snapshot-typescript should work with typescript 6 #63427

@kapouer

Description

@kapouer

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'
       }
     });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions