Skip to content

Commit e15093c

Browse files
committed
test(linter/new-cap): add tests for Intl.DateTimeFormat (#12878)
Related: #12856
1 parent 626ca4e commit e15093c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/oxc_linter/src/rules/eslint/new_cap.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,10 @@ fn test() {
750750
("Date?.UTC();", None), // { "ecmaVersion": 2020 },
751751
("(Date?.UTC)();", None), // { "ecmaVersion": 2020 }
752752
(r#"expect(1)[""](1);"#, None),
753+
(
754+
"let tz = Intl.DateTimeFormat().resolvedOptions().timezone()",
755+
Some(serde_json::json!([{ "capIsNewExceptions": ["Intl.DateTimeFormat"] }])),
756+
),
753757
];
754758

755759
let fail = vec![

0 commit comments

Comments
 (0)