Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

120
Views
Token.findForRequest is not a function

Using loopback v3 with jest and supertest. We are using the token middleware for authorization. In setup and teardown it works properly but when test cases are ran the middleware errors out with "Token.findForRequest is not a function". I tried logging it from the setup/teardown and it is a function but when I log it from tests it shows undefined.

This is how I am setting up supertest.

const request = require('supertest')(require('../../../server/server'));

// tests or setup/teardown code
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!