Skip to content

Tests using implicit testing vs explicit assertions #417

Closed

Description

@lwasser

When migrating from kcd-scripts to a native ESLint configuration, the Jest plugin for ESLint failed some of our tests because they violated the expect-expect rule. Because of that, I allowed the tests to pass by adding a comment above for the linter, as seen in the pr this comment started within. See example below.

When we move to vitest (if we move) this might no longer be an issue but ignoring this rule for now allows us to move forward with native linting config without test rewrites.

/ When we move to vitest this might not be an issue anymore
// eslint-disable-next-line jest/expect-expect
test('attaches no token when not supplied', async () => {
  nock('https://api.github.com')
    .matchHeader('authorization', '')
    .get('/users/test-token')
    .reply(200, {
      html_url: 'test-token',
    })

  await getUserInfo('test-token')
})

Added some inline todos as I made some decisions here that I'd like to better understand! I don't know what best practices are in the JS world, but the {} seems like the modern way to "catch" an error without doing anything with it.

Originally posted by @lwasser in #402

Activity

  1. changed the title [-]Tests using implicit testing vs explicity assertions[/-] [+]Tests using implicit testing vs explicit assertions[/+] on Feb 4, 2026
  2. lwasser commented on Feb 13, 2026

    @lwasser
    MemberAuthor

    closing this as i suspect with the move to more current tooling it's not going to be relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions