adding jest test setup

Summary:
Adds a test runner for jest test and adds three simple test cases:
- render the app
- start a server
- client connecting to the app

Test can be run using `yarn test`.

To make the test runner work, some changes needed to be made:
- remove the export of `init()` from `'flipper'`, because it was a cyclic dependency
- updating Button.js to the new ref-API

Reviewed By: jknoxville

Differential Revision: D10027078

fbshipit-source-id: 49107b0dd4dec666b92ecd841422fe7e6b3a7756
This commit is contained in:
Daniel Büchele
2018-09-28 06:31:48 -07:00
committed by Facebook Github Bot
parent af1ff7f039
commit a455520ecb
14 changed files with 2191 additions and 511 deletions

View File

@@ -0,0 +1,46 @@
// flow-typed signature: 0ce56690a743910f5934d0ffc0f26d61
// flow-typed version: <<STUB>>/redux-mock-store_v1.5.3/flow_v0.76.0
/**
* This is an autogenerated libdef stub for:
*
* 'redux-mock-store'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share your work with the
* community by sending a pull request to:
* https://github.com/flowtype/flow-typed
*/
declare module 'redux-mock-store' {
declare module.exports: any;
}
/**
* We include stubs for each file inside this npm package in case you need to
* require those files directly. Feel free to delete any files that aren't
* needed.
*/
declare module 'redux-mock-store/lib/index' {
declare module.exports: any;
}
declare module 'redux-mock-store/test/index' {
declare module.exports: any;
}
declare module 'redux-mock-store/test/mock/middleware' {
declare module.exports: any;
}
// Filename aliases
declare module 'redux-mock-store/lib/index.js' {
declare module.exports: $Exports<'redux-mock-store/lib/index'>;
}
declare module 'redux-mock-store/test/index.js' {
declare module.exports: $Exports<'redux-mock-store/test/index'>;
}
declare module 'redux-mock-store/test/mock/middleware.js' {
declare module.exports: $Exports<'redux-mock-store/test/mock/middleware'>;
}