Created
July 19, 2017 10:11
-
-
Save savelichalex/899b3da53c8ef2de2eb664829b97cf7d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// some-js-file.js | |
export const myFunctionToTestWithRNFS = (fs) => { | |
fs.readDir(...); | |
}; | |
// some-file-when-use-rnfs.js | |
import RNFS from 'react-native-fs'; | |
import { myFunctionToTestWithRNFS } from './some-js-file.js'; | |
myFunctionToTestWithRNFS(RNFS); | |
// tests | |
import { myFunctionToTestWithRNFS } from './some-js-file.js'; | |
describe('My tests', () => { | |
it('should test my function with fs mock', () => { | |
myFunctionToTestWithRNFS({ | |
readDir: () => {}, | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment