question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Images are stubbed as Objects instead of Strings

See original GitHub issue

When importing an image, the import returns an empty Object instead of a an empty String. This causes issues with prop type validation / type checking.

I don’t understand how it’s happening as all the index.js of this package does is return '', but in a normal Vue CLI 3 setup with jest enabled, the prop type for images is object.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
eddyerburghcommented, Feb 3, 2019

2.0.0 now stubs as an empty string by default 👍

1reaction
eddyerburghcommented, Oct 1, 2018

You could pass it in as a prop in the test:

const wrapper = shallowMount(HelloWorld, {     
  propsData: { msg, image: 'some-string' }
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

What's the difference between faking, mocking, and stubbing?
Fakes, stubs, and mocks all belong to the category of test doubles. A test double is any object or system you use in...
Read more >
Stubs and Mocking
The Lowly Stub ... Replacing the Name and Address classes by simple strings. ... The (main) mock graphics object is created here.
Read more >
Stubbing and Mocking in Java with the Spock Testing ...
Learn how to create true Java unit tests by mocking all external dependencies in your unit tests with the Spock testing framework.
Read more >
How to use Stub API in the following scenario?
StubProvider { public static List<User> userList; public Object handleMethodCall(Object stubbedObject, String stubbedMethodName, ...
Read more >
Stubbing, Mocking and Service Virtualization Differences for ...
dummy object (a string “Mike”); stub (a StubUserRepository class ... one of the service virtualization platforms instead of building the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found