Comments (4)
in our mocha config we do --register
a file that looks like this:
require('react-native-mock/mock');
require('babel-core/register')({
ignore: function(packageName) {
if (packageName.match(/node_modules/)) {
return !(packageName.match(/react-native-vector-icons/)
|| packageName.match(/react-native-animatable/)
);
}
return false;
}
});
[...]
from react-native-mock.
I'm receiving a flow error I guess
react-native-vector-icons/lib/create-icon-set.js:39
function createIconSet(glyphMap : Object, fontFamily : string, fontFile : string) : Function {
^
SyntaxError: Unexpected token :
is there a workaround for this for now?
from react-native-mock.
I'm receiving this error when I try to run tests with react-native-router-flux
app/node_modules/babel-core/lib/transformation/file/index.js:591
throw err;
^
SyntaxError: app/node_modules/react-native-router-flux/src/menu_burger.png: Unexpected character '�' (1:0)
> 1 | �PNG
| ^
2 |
3 |
this is my testHelper.js file
require('babel-polyfill');
require('react-native-mock/mock');
require('babel-core/register')({
ignore: function(packageName) {
if (packageName.match(/node_modules/)) {
return !(packageName.match(/react-native-vector-icons/)
|| packageName.match(/react-native-animatable/)
|| packageName.match(/react-native-router-flux/)
|| packageName.match(/react-native-tab-navigator/)
);
}
return false;
}
});
and this is my npm test script
"test": "node_modules/.bin/mocha --compilers js:babel-core/register --require testHelper.js **/__test__/*.js",
any workaround to handle this?
from react-native-mock.
@sibeliusseraphini Yes, this occurs when node tries to require an image as JS. See #11 for more discussions
from react-native-mock.
Related Issues (20)
- React v15.5.0 Deprecation Warnings HOT 3
- Need a way to reset _animationFrame count HOT 2
- Mock for i18nManager HOT 3
- Missing support for percentage widths HOT 1
- Does it support mock fetch? HOT 3
- Invariant Violation: Native module cannot be null. HOT 6
- TypeError: Cannot read property 'number' of undefined HOT 23
- Cannot find module 'react/lib/ReactComponentTreeHook' from 'ReactDebugTool.js' HOT 35
- not able to install from npm HOT 6
- Plans to support FlatList HOT 1
- Should `babel-preset-airbnb` be in `dependencies`? HOT 1
- Warning: ReactTestUtils has been moved to react-dom/test-utils HOT 1
- Issue using via package manager since build is required HOT 6
- View.PropTypes is depricated but still used here. HOT 2
- emitting event from native ios working example
- Animated Delay is not exported HOT 1
- Animated is not fully mocked
- No wiki page now HOT 1
- Cannot find module 'ReactPerf' from 'react-native.js'
- Maintainers wanted HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-mock.