API: mock source.input.file
See original GitHub issueI need to prevent my plugin to run on css files inside /node_modules
.
For that I check for the value of rule.source.input.file
.
root.walkDecls(rule => {
if (rule.source.input.file && rule.source.input.file.indexOf('/node_modules') > 0) {
return false;
}
// ...
}
Now I want to do a Jest test with it, but the input.file
is always undefined
.
How do I mock it?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Create Rest Mock API in Seconds With These 9 Tools
Are you looking for a platform to run mock REST APIs quickly and easily? Opt for Mockoon, a free and open-source platform to...
Read more >Create mock APIs in seconds with Mockoon
Mockoon is the easiest and quickest way to design and run mock REST APIs. No remote deployment, no account required, free and open-source....
Read more >How to Mock API Calls in Test Environments - Stoplight Blog
Stoplight has an open source mock server that generates from OpenAPI documents. ... Automated API testing is a great way to ensure the...
Read more >How to provide mock files to change event of <input type='file ...
Here is an example spec for input file/image using angular2+. it('should call showError on toastService Api on call of onSaveOfImage() ...
Read more >How to make a mock API server in JavaScript - Snyk
To speed up your development process, you will create a mock server. In your src directory, create a file called mock.js and add...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Add this code (replace similar code in the to of test file).
Hey it worked!
Thanks 🎉