Comments (6)
Ok, might as well show some other changes made for this:
Added /jest directory
In package.json under 'scripts:
Replace Ava stuff with Jest stuff:
Remove
"test": "ava",
"test:watch": "ava --watch",
"coverage": "nyc ava && nyc report --reporter=html && open coverage/index.html || xdg-open coverage/index.html",
Replace:
"test": "jest",
"updateSnapshot": "jest --updateSnapshot",
"test:watch": "jest --watch",
"coverage": "nyc jest && nyc report --reporter=html && open coverage/index.html || xdg-open coverage/index.html",
in package.json, removed Ava node
"ava": {
"files": [
"Tests/**/*.js",
"!Tests/Setup.js"
],
"require": [
"babel-register",
"babel-polyfill",
"react-native-mock/mock",
"./Tests/Setup"
],
"babel": "inherit"
in package.json added Jest node
"jest": {
"preset": "react-native",
"setupFiles": [
"./jest/setup.js"
]
},
Removed unused devDependencies from package.json
"enzyme": "^2.6.0",
"react-dom": "^15.4.0",
"react-native-mock": "^0.3.1",
Added Jest devDependencies in package.json
"babel-preset-react-native": "1.9.1",
"jest": "^19.0.2",
"jest-react-native": "^18.0.0",
"react-test-renderer": "^15.5.4",
Added: jest/setup.js
// add any mocks you need, based on any mocks you created previously for Ava. The following is
// just an example that you can use to create your own mock!!!
jest
.mock('react-native-device-info', () => {
return { isTablet: jest.fn() }
})
.mock('react-native-router-flux', () => {
return {
Actions: {'myScreen': () => {}},
ActionConst: {RESET: 'reset'}
}
})
.mock('react-native-keyboard-spacer', () => 'KeyboardSpacer')
.mock('react-native-i18n', () => {
const english = require('../App/I18n/languages/english.json')
const keys = require('ramda')
const replace = require('ramda')
const forEach = require('ramda')
return {
t: (key, replacements) => {
let value = english[key]
if (!value) return key
if (!replacements) return value
forEach((r) => {
value = replace(`{{${r}}}`, replacements[r], value)
}, keys(replacements))
return value
}
}
})
from ignite-andross.
Added to our next Ignite core team meeting agenda.
from ignite-andross.
cc @derekgreenberg @robinheinze
from ignite-andross.
I used jest-codemods to port the Ava unit tests over to Jest for a project (built from ignite 2.0) and it worked perfectly.
from ignite-andross.
Sorceror!
from ignite-andross.
Fixed in #30 . 🎉 🌮
from ignite-andross.
Related Issues (20)
- Check the render method of 'NavigatorReduxWrapper'. HOT 6
- RN60+ issue for Andross project HOT 4
- Example gives cannot read property 'includes' of undefined HOT 2
- AndroidManifest merger error on run HOT 9
- Crash after upgrade to 0.61 HOT 1
- Andross is not actual - problem with andoidx
- [Bug] Can not Create new Project on Windows 10 HOT 8
- Command failed : gradlew.bat app:installDebug. when run react-native run-android HOT 4
- console.tron.log is undefined HOT 9
- TypeError: undefined is not an object (evaluating '_reactNavigation.ThemeColors.light') HOT 27
- failed to add React Native 0.61.4 HOT 1
- Problem with storyBook
- Error Occured while running npx react-native run-android command
- Error: `createStackNavigator()` has been moved to `react-navigation-stack`. HOT 2
- currentlyFocusedField is deprecated and will be removed in a future release. Use currentlyFocusedInput
- How to ingnite-andross use TypeScript when init project?
- Add config option to remove Redux Navigation
- Errors while running `npx react-native run-ios`. Afte resolving errors, Andross rendering correctly on Android, but not on iOS
- generate list didnt show any option
- APIs are not called in background - ios
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 ignite-andross.