File tree Expand file tree Collapse file tree 5 files changed +12
-8
lines changed
Expand file tree Collapse file tree 5 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { configure } from '@provenance/react-native-provenance';
33if ( process . env . EXPO_PUBLIC_API_KEY && process . env . EXPO_PUBLIC_BUNDLE_ID ) {
44 configure ( {
55 apiHost : process . env . EXPO_PUBLIC_API_HOST ,
6- key : process . env . EXPO_PUBLIC_API_KEY ,
6+ apiKey : process . env . EXPO_PUBLIC_API_KEY ,
77 bundleId : process . env . EXPO_PUBLIC_BUNDLE_ID ,
88 } ) ;
99} else {
Original file line number Diff line number Diff line change @@ -10,7 +10,11 @@ global.console = {
1010} ;
1111
1212const sampleApiKey = 'test-api-key' ;
13- configure ( { key : sampleApiKey , bundleId : 'a-bundle-id' , apiHost : 'staging' } ) ;
13+ configure ( {
14+ apiKey : sampleApiKey ,
15+ bundleId : 'a-bundle-id' ,
16+ apiHost : 'staging' ,
17+ } ) ;
1418
1519describe ( 'getOffers' , ( ) => {
1620 beforeEach ( ( ) => {
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ global.console = {
2121
2222describe ( 'TrustBadge' , ( ) => {
2323 configure ( {
24- key : 'test-api-key' ,
24+ apiKey : 'test-api-key' ,
2525 bundleId : 'fakeBundleId' ,
2626 apiHost : 'staging' ,
2727 } ) ;
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ describe('Errors', () => {
2222 describe ( 'when onError callback configured' , ( ) => {
2323 it ( 'passes the error to the callback' , ( ) => {
2424 const onError = jest . fn ( ) ;
25- configure ( { onError, key : 'a-key' , bundleId : 'a-bundle' } ) ;
25+ configure ( { onError, apiKey : 'a-key' , bundleId : 'a-bundle' } ) ;
2626 Errors . handle ( anError ) ;
2727
2828 expect ( onError ) . toHaveBeenCalledWith ( anError ) ;
Original file line number Diff line number Diff line change @@ -27,15 +27,15 @@ export function getClientHeaders() {
2727type ApiHost = 'staging' | 'production' | string ;
2828
2929type ConfigurationOptions = {
30- key : string ;
30+ apiKey : string ;
3131 bundleId : string ;
3232 apiHost ?: ApiHost ;
3333 onError ?: OnErrorCallback ;
3434} ;
3535
3636export const configure = ( options : ConfigurationOptions ) => {
3737 try {
38- setApiKey ( options . key ) ;
38+ setApiKey ( options . apiKey ) ;
3939 setBundleId ( options . bundleId ) ;
4040
4141 if ( options . apiHost ) {
@@ -76,7 +76,7 @@ class ProvenanceConfigError extends Error {
7676function setApiKey ( key : string ) {
7777 if ( ! key ?. trim ( ) )
7878 throw new ProvenanceConfigError (
79- '"key " is missing. Please provide API key.'
79+ '"apiKey " is missing in `configure` call . Please provide API key.'
8080 ) ;
8181
8282 apiKey = key ;
@@ -85,7 +85,7 @@ function setApiKey(key: string) {
8585function setBundleId ( bundleIdValue : string ) {
8686 if ( ! bundleIdValue ?. trim ( ) )
8787 throw new ProvenanceConfigError (
88- '"bundleId" is missing. Please provide valid Bundle Id'
88+ '"bundleId" is missing in `configure` call . Please provide valid Bundle Id'
8989 ) ;
9090
9191 bundleId = bundleIdValue ;
You can’t perform that action at this time.
0 commit comments