-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Harley Alexander
authored and
Harley Alexander
committed
Jun 23, 2020
1 parent
0460115
commit bd96f9f
Showing
14 changed files
with
3,039 additions
and
119 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
const config = require("./jest.config"); | ||
// jest.config.js | ||
const { defaults: tsjPreset } = require("ts-jest/presets"); | ||
|
||
module.exports = { | ||
...config, | ||
preset: "react-native" | ||
...tsjPreset, | ||
preset: "react-native", | ||
transform: { | ||
...tsjPreset.transform, | ||
"\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js", | ||
}, | ||
globals: { | ||
"ts-jest": { | ||
babelConfig: true, | ||
}, | ||
}, | ||
testPathIgnorePatterns: ["<rootDir>/src/__tests__/useTrigger.tsx"], | ||
// This is the only part which you can keep | ||
// from the above linked tutorial's config: | ||
cacheDirectory: ".jest/cache", | ||
setupFiles: ["<rootDir>/setupTests.rn.js"], | ||
}; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
getTransformModulePath() { | ||
return require.resolve("react-native-typescript-transformer"); | ||
}, | ||
getSourceExts() { | ||
return ["ts", "tsx"]; | ||
}, | ||
}; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import mockRNCNetInfo from "@react-native-community/netinfo/jest/netinfo-mock.js"; | ||
|
||
jest.mock("@react-native-community/netinfo", () => mockRNCNetInfo); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from "react"; | ||
import Pusher from "pusher-js/react-native"; | ||
import { PusherProvider as CorePusherProvider } from "../PusherProvider"; | ||
import { PusherProviderProps } from "../types"; | ||
|
||
export { __PusherContext } from "../PusherProvider"; | ||
|
||
/** Wrapper around the core PusherProvider that passes in the Pusher react-native lib */ | ||
export const PusherProvider: React.FC<PusherProviderProps> = (props) => ( | ||
<CorePusherProvider _PusherRuntime={Pusher} {...props} /> | ||
); |
Oops, something went wrong.