hosainnet / rnunittests Goto Github PK
View Code? Open in Web Editor NEWReact Native unit testing
React Native unit testing
Great thanks for your article!
Please add note for using es6 exports default
feature.
If we export MoviesView
as:
export default class MoviesView extends Component {
...
}
then in test we should require it as
var MoviesView = require('../../view/MoviesView').default;
...
Hey there,
Thanks for this awesome example, I was looking for a while for a working example, and the tests are running, great!
But.. when I'm trying to run react-native run-ios
or start it from xcode, I get the following error:
Error building DependencyGraph:
Error: Naming collision detected: /Users/Benjamin/P/RNUnitTests/node_modules/react/node_modules/fbjs/lib/warning.js collides with /Users/Benjamin/P/RNUnitTests/node_modules/react-native/node_modules/fbjs/lib/warning.js
It looks like react-addons-test-utils
has a dependency of react
, and the dependencies of react
and react-native
are colliding.
So, as test, I removed the devDependencies from the package.json, and then it works like expected. (Showing nothing more then the reacts AwesomeProject, the rest is not included).
Some info:
[email protected]
node: v4.2.1
npm: 2.14.7
What would be the best way to fix this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.