Skip to content

TypeError: TokenModel.findForRequest is not a function #4356

Open
@ThatAnonyG

Description

@ThatAnonyG

Steps to reproduce

Setup the tests with Jest.
Enabled token middleware authentication.
Trying to call protected endpoint via supertest.

Current Behavior

When calling the endpoint from inside any test block like beforeAll or it I am getting the error "TypeError: TokenModel.findForRequest is not a function". And upon logging I see that the function is not even present.

Calling it from setup files like globalSetup or globalTeardown I do not get any such errors.

Expected Behavior

The function should be defined.

Link to reproduction sandbox

I dont know what this means.

Additional information

darwin x64 14.19.1
"loopback": "^3.9.0"
"loopback-boot": "^2.6.5"
"loopback-connector-mysql": "^6.1.0"
"loopback-context": "^3.3.0"

Related Issues

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions