Skip to content

fix: remove duplicate bearer() method#893

Open
susheela-hinchig wants to merge 1 commit into
forwardemail:masterfrom
susheela-hinchig:fix/duplicate-bearer-method
Open

fix: remove duplicate bearer() method#893
susheela-hinchig wants to merge 1 commit into
forwardemail:masterfrom
susheela-hinchig:fix/duplicate-bearer-method

Conversation

@susheela-hinchig

Copy link
Copy Markdown

What

lib/test.js defines bearer(token) twice. The two definitions are identical,
so the second just shadows the first. This removes the duplicate (and its
duplicate comment block), leaving a single definition.

Why it wasn't caught

The lint config extends airbnb-base/legacy, which is the ES5 ruleset and
doesn't include no-dupe-class-members, so npm run lint passes despite the
duplicate. Running ESLint with that rule enabled flags it:

lib/test.js
  227:3  error  Duplicate name 'bearer'  no-dupe-class-members

Verification

  • npm run lint passes
  • npm test passes (130 passing) — .bearer() is already covered in
    test/supertest.js, and behaviour is unchanged since the removed copy was
    identical

No functional change; this just deletes dead duplicate code.

Checklist

  • I have ensured my pull request is not behind the main or master branch of the original repository.
  • I have rebased all commits where necessary so that reviewing this pull request can be done without having to merge it first.
  • I have written a commit message that passes commitlint linting.
  • I have ensured that my code changes pass linting tests.
  • I have ensured that my code changes pass unit tests.
  • I have described my pull request and the reasons for code changes along with context if necessary.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant