mirror of
https://github.com/zoriya/react-native-background-downloader.git
synced 2026-06-07 11:34:43 +00:00
jest test suite - work start
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
import { NativeModules } from 'react-native';
|
||||
|
||||
NativeModules.RNBackgroundDownload = {
|
||||
download: jest.fn(),
|
||||
addListener: jest.fn()
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
import RNBackgroundDownload from '../index';
|
||||
import DownloadTask from '../lib/downloadTask';
|
||||
|
||||
test('download should return a downloadTask', () => {
|
||||
expect(RNBackgroundDownload.download({
|
||||
id: 'test',
|
||||
url: 'test',
|
||||
destination: 'test'
|
||||
})).toBeInstanceOf(DownloadTask);
|
||||
});
|
||||
+9
-2
@@ -1,11 +1,10 @@
|
||||
|
||||
{
|
||||
"name": "react-native-background-download",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"test": "jest"
|
||||
},
|
||||
"keywords": [
|
||||
"react-native"
|
||||
@@ -14,5 +13,13 @@
|
||||
"license": "",
|
||||
"peerDependencies": {
|
||||
"react-native": "^0.41.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jest": "^23.1.0",
|
||||
"react-native": "^0.55.4"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "react-native",
|
||||
"setupFiles": ["./__mocks__/RNBackgroundDownload.js"]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user