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

Vue CLI: Namespace 'jest' has no exported member 'MockedFunction' during build #6

Open
davestewart opened this issue Sep 15, 2020 · 2 comments

Comments

@davestewart
Copy link

davestewart commented Sep 15, 2020

Google search terms

The error message of this issue

Describe the bug

Have set up Jest Chrome in an existing Vue project, and when I run the build the screen fills with 100s and 100s of lines the following:

ERROR in /Volumes/Data/Work/Current/.../node_modules/jest-chrome/types/jest-chrome.d.ts(6092,31):
6092:31 Namespace 'jest' has no exported member 'MockedFunction'.
    6090 |    * function(string result) {...};
    6091 |    */
  > 6092 |   export const getTitle: jest.MockedFunction<typeof chrome.pageAction.getTitle>
         |                               ^
    6093 |   /**
    6094 |    * Gets the html document set as the popup for this page action.
    6095 |    *
ERROR in /Volumes/Data/Work/Current/.../node_modules/jest-chrome/types/jest-chrome.d.ts(6102,31):
6102:31 Namespace 'jest' has no exported member 'MockedFunction'.
    6100 |    * function(string result) {...};
    6101 |    */
  > 6102 |   export const getPopup: jest.MockedFunction<typeof chrome.pageAction.getPopup>
         |                               ^
    6103 |   /**
    6104 |    * Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.
    6105 |    *
ERROR in /Volumes/Data/Work/Current/.../node_modules/jest-chrome/types/jest-chrome.d.ts(6110,30):
6110:30 Namespace 'jest' has no exported member 'MockedFunction'.
    6108 |    * function() {...};
    6109 |    */
  > 6110 |   export const setIcon: jest.MockedFunction<typeof chrome.pageAction.setIcon>
         |                              ^
    6111 |
    6112 |   /** Fired when a page action icon is clicked. This event will not fire if the page action has a popup. */
    6113 |   export const onClicked: PageActionClickedEvent

How do we reproduce?

Unsure. This is a Vue project around 18 months old.

Also just upgraded the Vue CLI to the latest copy of everything, which brought its own issues (I think the compiler / linting settings are more aggressive) – not sure if they are connected.

Vue uses its own copy of Jest, but to be on the safe side, I installed Jest again as a peer dependency, but no luck.

Expected behavior

The build compiles with no warnings.

Actual behavior

See above.

The build still works, but the terminal is hosed with messages.

Screenshots

See copy/paste above

Please complete the following information:

  • Library Version: 0.7.0
  • Operating System: OSX
  • Browser: Chrome
  • Node Version: 12

Additional context

@jacksteamdev jacksteamdev changed the title 100s of warnings of Namespace 'jest' has no exported member 'MockedFunction' during build Vue CLI: 100s of warnings of Namespace 'jest' has no exported member 'MockedFunction' during build Sep 15, 2020
@davestewart
Copy link
Author

Hi.

Any update on this, or way to mitigate until you get a chance to look at it?

Cheers,
Dave

@jacksteamdev jacksteamdev changed the title Vue CLI: 100s of warnings of Namespace 'jest' has no exported member 'MockedFunction' during build Vue CLI: Namespace 'jest' has no exported member 'MockedFunction' during build Sep 17, 2020
@davestewart
Copy link
Author

davestewart commented Sep 19, 2020

Have downgraded packages again to get a build that works.

Got some advice from Lachlan Miller who maintains Vue Test Utils and he suggested upgrading Jest, but critically also Jest types – which perhaps were missed in the previous upgrade – to v25:

I've downgraded for now, but once my next release is out I can look to upgrade again.

If you keep this ticket open I can report back when that happens.

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

1 participant