Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS Mock doesn't use imported interfaces #2

Open
gormonn opened this issue Jul 29, 2021 · 5 comments
Open

TS Mock doesn't use imported interfaces #2

gormonn opened this issue Jul 29, 2021 · 5 comments

Comments

@gormonn
Copy link

gormonn commented Jul 29, 2021

TS Mock doesn't use imported interfaces.

For example:

import {Bar,Fizz} from './'

interface Foo {
 bar: Bar,
 fizz: Fizz
}

returns:

{
  "Foo": {
    bar: {},
    fizz: {}
  }
}
@981377660LMT
Copy link
Owner

TS Mock doesn't use imported interfaces.

For example:

import {Bar,Fizz} from './'

interface Foo {
 bar: Bar,
 fizz: Fizz
}

returns:

{
  "Foo": {
    bar: {},
    fizz: {}
  }
}

In fact, I haven't considered importing interfaces from other files 😮.But this is a good idea. I will implement this as soon as possible.
In addition, I noticed that some primitive types cannot be supported well by intermock.This makes me a little confused.

@981377660LMT
Copy link
Owner

TS Mock doesn't use imported interfaces.

For example:

import {Bar,Fizz} from './'

interface Foo {
 bar: Bar,
 fizz: Fizz
}

returns:

{
  "Foo": {
    bar: {},
    fizz: {}
  }
}

I have supported this feature by modifing intermock's source code, you can have a look here(mocha-test passed).
But in order to add this feature to ts-mock plugin, I need to modify intermock's source code intrusively. I think it is not very nice and feel confused 😖.

@gormonn
Copy link
Author

gormonn commented Aug 2, 2021

What if make PR to intermock?

@981377660LMT
Copy link
Owner

What if make PR to intermock?

I will have a try when I am free 🐤 .

@damiangreen
Copy link

Is that the reason I get "Unsupported Primitive type 110" or is that a separate issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants