@@ -13,7 +13,6 @@ import {
1313} from './data-store'
1414
1515jest . mock ( './utils' , ( ) => ( {
16- isRemote : jest . fn ( ) ,
1716 logMRTError : jest . fn ( )
1817} ) )
1918
@@ -28,7 +27,7 @@ jest.mock('@aws-sdk/lib-dynamodb', () => ({
2827 GetCommand : jest . fn ( )
2928} ) )
3029
31- import { isRemote , logMRTError } from './utils'
30+ import { logMRTError } from './utils'
3231import { DynamoDBClient } from '@aws-sdk/client-dynamodb'
3332import { DynamoDBDocumentClient , GetCommand } from '@aws-sdk/lib-dynamodb'
3433
@@ -47,8 +46,7 @@ describe('DataStore', () => {
4746 send : mockSend
4847 } )
4948
50- // Default to remote environment
51- isRemote . mockReturnValue ( false )
49+ // Default to the data store being available
5250 process . env . AWS_REGION = 'ca-central-1'
5351 process . env . MOBIFY_PROPERTY_ID = 'my-project'
5452 process . env . DEPLOY_TARGET = 'my-target'
@@ -75,28 +73,14 @@ describe('DataStore', () => {
7573 } )
7674
7775 describe ( 'isDataStoreAvailable' , ( ) => {
78- test ( 'should return true when remote' , ( ) => {
79- delete process . env . AWS_REGION
80- delete process . env . MOBIFY_PROPERTY_ID
81- delete process . env . DEPLOY_TARGET
82-
83- const store = DataStore . getDataStore ( )
84-
85- expect ( store . isDataStoreAvailable ( ) ) . toBe ( true )
86- } )
87-
88- test ( 'should return true when local and all required env vars are set' , ( ) => {
89- isRemote . mockReturnValue ( true )
90-
76+ test ( 'should return true when all required env vars are set' , ( ) => {
9177 const store = DataStore . getDataStore ( )
92-
9378 expect ( store . isDataStoreAvailable ( ) ) . toBe ( true )
9479 } )
9580
9681 test . each ( [ 'AWS_REGION' , 'MOBIFY_PROPERTY_ID' , 'DEPLOY_TARGET' ] ) (
97- 'should return false when local and %s is missing' ,
82+ 'should return false when %s is missing' ,
9883 ( environmentVariableName ) => {
99- isRemote . mockReturnValue ( true )
10084 delete process . env [ environmentVariableName ]
10185
10286 const store = DataStore . getDataStore ( )
@@ -108,9 +92,8 @@ describe('DataStore', () => {
10892
10993 describe ( 'getEntry' , ( ) => {
11094 test . each ( [ 'AWS_REGION' , 'MOBIFY_PROPERTY_ID' , 'DEPLOY_TARGET' ] ) (
111- 'should throw DataStoreUnavailableError when local and %s is missing' ,
95+ 'should throw DataStoreUnavailableError when %s is missing' ,
11296 async ( environmentVariableName ) => {
113- isRemote . mockReturnValue ( true )
11497 delete process . env [ environmentVariableName ]
11598
11699 const store = DataStore . getDataStore ( )
0 commit comments