Jest testing with angular ionic storage is failing

Hi i am using angular 11 and ionic 5 ;

for ionic storage i am using @ionic/storage-angular:^3.0.6 module.

during jest unit tests i am getting

Cannot find module ‘@ionic/storage’ from

@ionic/storage-angular is a dependency in one of the service which i mocked

jest.confi.js has

transformIgnorePatterns: [

spec file mocking the service

let storeServiceStub={

await TestBed.configureTestingModule({
      declarations: [ DataSyncComponent ],
        { provide: StoreService, useValue: storeServiceStub },

@ionic/storage-angular is a of store service which i m replacing with stub;

testing env to repo bug

  "@ionic/storage-angular": "^3.0.6",
  "jest": "^27.0.3",
  "jest-preset-angular": "^9.0.1",
  "@types/jest": "^26.0.23",


node v 14
os osx 11.2.2

Same issue here. Could you fix it?

I can fix it adding the following configuration in my jest.config.js

moduleNameMapper: {
        '^@ionic/storage': '<rootDir>/node_modules/@ionic/storage/dist/esm/index.d.ts',

My complete configuration is

module.exports = {
    "preset": "jest-preset-angular",
    "setupFilesAfterEnv": ["<rootDir>/setup-jest.ts"],
    "transformIgnorePatterns": [
    moduleNameMapper: {
        '^@ionic/storage': '<rootDir>/node_modules/@ionic/storage/dist/esm/index.d.ts',
    setupFiles: ["jest-canvas-mock"]

I hope this helps.