From 5c20c521c84ebb9f7b3a3f515d22f945bf44e2e5 Mon Sep 17 00:00:00 2001 From: Mark Skelton Date: Sun, 8 Sep 2024 22:11:17 -0500 Subject: [PATCH] Add test Fixes #307 --- src/rules/prefer-to-have-length.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/rules/prefer-to-have-length.test.ts b/src/rules/prefer-to-have-length.test.ts index 6f7e66b..8a39612 100644 --- a/src/rules/prefer-to-have-length.test.ts +++ b/src/rules/prefer-to-have-length.test.ts @@ -65,6 +65,13 @@ runRuleTester('prefer-to-have-length', rule, { }, }, }, + { + code: 'expect((await table.rows.all()).length).toBe(5)', + errors: [ + { column: 41, endColumn: 45, line: 1, messageId: 'useToHaveLength' }, + ], + output: 'expect((await table.rows.all())).toHaveLength(5)', + }, ], valid: [ 'expect(files).toHaveLength(1)',