Parcourir la source

fix type error

Yuki Takei il y a 1 an
Parent
commit
81634a1b05
1 fichiers modifiés avec 10 ajouts et 1 suppressions
  1. 10 1
      apps/app/src/server/service/import/import.spec.ts

+ 10 - 1
apps/app/src/server/service/import/import.spec.ts

@@ -19,6 +19,15 @@ vi.mock('./construct-convert-map', () => ({
   constructConvertMap: mocks.constructConvertMapMock,
 }));
 
+
+/**
+ * Get private property from ImportService
+ */
+const getPrivateProperty = <T>(importService: ImportService, propertyName: string): T => {
+  return importService[propertyName];
+};
+
+
 describe('ImportService', () => {
 
   let importService: ImportService;
@@ -46,7 +55,7 @@ describe('ImportService', () => {
       // assert
       expect(mocks.setupIndependentModelsMock).toHaveBeenCalledOnce();
       expect(mocks.constructConvertMapMock).toHaveBeenCalledOnce();
-      expect(importService.convertMap).toStrictEqual(convertMapMock);
+      expect(getPrivateProperty(importService, 'convertMap')).toStrictEqual(convertMapMock);
     });
   });
 });