Skip to content

Commit 244633b

Browse files
authored
fixed class name test to work in all versions of node (#862)
Co-authored-by: Tom <tomblind@users.noreply.github.com>
1 parent 8487f7a commit 244633b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/unit/classes/classes.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,10 +788,12 @@ test("default exported anonymous class has 'default' name property", () => {
788788
test("constructor class name available with constructor", () => {
789789
util.testModule`
790790
const decorator = <T extends new (...args: any[]) => any>(constructor: T) => class extends constructor {};
791-
791+
792792
@decorator
793793
class MyClass {}
794794
795795
export const className = new MyClass().constructor.name;
796-
`.expectToMatchJsResult();
796+
`
797+
.setReturnExport("className")
798+
.expectToEqual("MyClass");
797799
});

0 commit comments

Comments
 (0)