Skip to content

Commit

Permalink
chore: add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
shulaoda committed Aug 25, 2024
1 parent b0d95d7 commit 6bc6151
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions crates/oxc_linter/src/rules/jest/prefer_to_have_length.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ fn tests() {
"expect((meta.get('pages') as YArray<unknown>).length).toBe((originalMeta.get('pages') as YArray<unknown>).length);",
None
),
(
"expect(assetTypeContainer.getElementsByTagName('time').length).toEqual(
0,
);", None)
];

let fix = vec![
Expand Down Expand Up @@ -247,6 +251,15 @@ fn tests() {
"expect((meta.get('pages') as YArray<unknown>)).toHaveLength((originalMeta.get('pages') as YArray<unknown>).length);",
None
),
(
"expect(assetTypeContainer.getElementsByTagName('time').length).toEqual(
0,
);",
"expect(assetTypeContainer.getElementsByTagName('time')).toHaveLength(
0,
);",
None
)
];

Tester::new(PreferToHaveLength::NAME, pass, fail)
Expand Down

0 comments on commit 6bc6151

Please sign in to comment.