Skip to content

Issue while running Jest tests #7

@smuralimohan

Description

@smuralimohan

Hi,

I am using Jest to test my user-service and my user-service has the following import:

import Hash from '@IOC:Adonis/Core/Hash'

When I run the test suite, it fails with the following error:

_Test suite failed to run

Cannot find module '@IOC:Adonis/Core/Hash' from 'services/user/index.ts'_
I have the following packages installed:
"adonis-jest": "^2.0.1",
"adonis-preset-ts": "^2.1.0",

and I have also configured my jest.config.js with the following:
preset: 'adonis-jest',

Any hints to fix the problem please?
Thanks

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