Skip to content

Commit c9bccc7

Browse files
Copilotsapphi-red
andcommitted
Apply formatting suggestion and add tests for object literals and class properties with string keys
- Format destructuring assignment tests on single lines as suggested - Add test for object literal with string key: ({ "test-key": key }) - Add test for class property with string key: (class { "test-key" = key }) Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
1 parent 5a24645 commit c9bccc7

File tree

1 file changed

+7
-4
lines changed
  • crates/oxc_codegen/tests/integration

1 file changed

+7
-4
lines changed

crates/oxc_codegen/tests/integration/js.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,14 @@ fn assignment() {
227227
test_minify("({ [a.b]: x } = foo);", "({[a.b]:x}=foo);");
228228

229229
test_minify(r#"({"my-key": value} = obj);"#, r#"({"my-key":value}=obj);"#);
230-
test_minify(
231-
r#"({["computed"]: a, "literal": b} = obj);"#,
232-
r#"({["computed"]:a,"literal":b}=obj);"#,
233-
);
230+
test_minify(r#"({["computed"]: a, "literal": b} = obj);"#, r#"({["computed"]:a,"literal":b}=obj);"#);
234231
test_minify(r#"let {"test-key": testKey} = obj;"#, r#"let{"test-key":testKey}=obj;"#);
232+
233+
// Object literals with string keys
234+
test_minify(r#"({ "test-key": key });"#, r#"({"test-key":key});"#);
235+
236+
// Class properties with string keys
237+
test_minify(r#"(class { "test-key" = key });"#, r#"(class{"test-key"=key});"#);
235238
}
236239

237240
#[test]

0 commit comments

Comments
 (0)