Add more tests for "assignment like" node (#19447)

This commit is contained in:
fisker Cheung authored and GitHub committed 2026-06-25 10:10:01 +08:00
1 parent 5c9fd27dfa
commit ebc995158b
8 files changed
+113 -10

No files matched your search

@@ -7216,7 +7216,7 @@ try {
================================================================================
`;
exports[`variable_declarator.js - {"semi":false} format 1`] = `
exports[`variable-declarator.js - {"semi":false} format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
semi: false
@@ -7366,7 +7366,7 @@ const foo3 = 123
================================================================================
`;
exports[`variable_declarator.js format 1`] = `
exports[`variable-declarator.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80 (default) |
@@ -0,0 +1,65 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`variable-declarator.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80 (default) |
=====================================input======================================
let a1 // commment
= 1;
let a12
// commment
= 1;
let a2 /* commment */
= 1;
let a22
/* commment */
= 1;
let a3 /*
commment */
= 1;
let a32
/*
commment */
= 1;
let a4 = // comment
1;
let a42 =
// comment
1;
let a5 = /* commment */
1;
let a52 =
/* commment */
1;
=====================================output=====================================
let a1 = 1; // commment
let a12 =
// commment
1;
let a2 = /* commment */ 1;
let a22 =
/* commment */
1;
let a3 =
/*
commment */
1;
let a32 =
/*
commment */
1;
let a4 =
// comment
1;
let a42 =
// comment
1;
let a5 = /* commment */ 1;
let a52 =
/* commment */
1;
================================================================================
`;
@@ -0,0 +1 @@
runFormatTest(import.meta, ["babel", "flow", "typescript"]);
@@ -0,0 +1,27 @@
let a1 // commment
= 1;
let a12
// commment
= 1;
let a2 /* commment */
= 1;
let a22
/* commment */
= 1;
let a3 /*
commment */
= 1;
let a32
/*
commment */
= 1;
let a4 = // comment
1;
let a42 =
// comment
1;
let a5 = /* commment */
1;
let a52 =
/* commment */
1;