250927.1 · e8b2a13326034c549b22671c09dc46fb7d3da6f3
test: add snapshot for short-circuit assignments
reading declarations
Changes to test/transform.test.js. All files
@@ -342,3 +342,28 @@ test("should have proper error code", (t) => { assert.strictEqual(error.code, "InvalidSyntax"); } });++test("should handle short-circuit assignments (&&=, ||=, ??=)", (t) => {+ const inputCode = `+ const a = {}++ a.foo &&= \`\${a.foo}1\`+ console.log(a.foo)++ const b = {}++ b.foo ||= \`\${b.foo}1\`+ console.log(b.foo)++ const c = {}++ c.foo ??= \`\${c.foo}1\`+ console.log(c.foo)+ `;++ const { code } = transformSync(inputCode, {+ mode: "transform",+ sourceMap: true,+ });+ t.assert.snapshot(code);+});