allenhwkim / ngentest

Angular6+ Unit Test Generator For Components, Directive, Services, and Pipes
https://ngentest.github.io
MIT License
144 stars 60 forks source link

In my case it failer because the model. #45

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hi,

In my case it failed because it not find the model: image image

What it's the problem?

allenhwkim commented 3 years ago

I tested similar one, and it seems working for me. If not working, plz use replacements(you can find in REAME.md) to modifiy code before generating test.

If still not working, create a simple component file which errored out for ngentest, and paste it here, so that i can take a look.

ghost commented 3 years ago

Hi,

Now, it's generated but I need to change the relative path by his path: Not generate this: import { Porpuse, Ru } from '@app/model/rus.model'; Or: import { Porpuse, Ru } from 'src/app/model/rus.model';

But with this path, yes: import { Porpuse, Ru } from './../../../../model/rus.model';

It's posible to review this option?

allenhwkim commented 3 years ago

Try this in your ngentest.config.js

replacements: [
  { from: 'src\\/app\\/model\\/rus\\.model', to: ''}`
]
ghost commented 3 years ago

Yes, with this change worked. Thanks.