diff --git a/packages/cli-test/src/cli/commands/datastore.spec.ts b/packages/cli-test/src/cli/commands/datastore.spec.ts index 9e8d8bddb..41f0b0720 100644 --- a/packages/cli-test/src/cli/commands/datastore.spec.ts +++ b/packages/cli-test/src/cli/commands/datastore.spec.ts @@ -36,7 +36,11 @@ describe('datastore commands', () => { }); describe('put method', () => { it('should invoke `datastore put [item details]`', async () => { - await datastore.datastorePut({ appPath: '/some/path', datastoreName: 'datastore', putItem: '{ "id": "1"}' }); + const itemObj: any = { + id: "1", + content: "text" + }; + await datastore.datastorePut({ appPath: '/some/path', datastoreName: 'datastore', putItem: itemObj }); sandbox.assert.calledWith( spawnSpy, sinon.match(`datastore put`), @@ -45,7 +49,10 @@ describe('datastore commands', () => { }); describe('query method', () => { it('should invoke `datastore query [expression]`', async () => { - await datastore.datastoreQuery({ appPath: '/some/path', datastoreName: 'datastore', queryExpression: 'id = :id', queryExpressionValues: '{ ":id": "1"}'}); + const expressObj: any = { + id: "1", + }; + await datastore.datastoreQuery({ appPath: '/some/path', datastoreName: 'datastore', queryExpression: 'id = :id', queryExpressionValues: expressObj}); sandbox.assert.calledWith(spawnSpy, sinon.match(`datastore query`)); }); }); diff --git a/packages/cli-test/src/cli/commands/datastore.ts b/packages/cli-test/src/cli/commands/datastore.ts index 8d0d4abde..7660f0e0a 100644 --- a/packages/cli-test/src/cli/commands/datastore.ts +++ b/packages/cli-test/src/cli/commands/datastore.ts @@ -7,11 +7,11 @@ export interface DatastoreCommandArguments { /** @description datastore get primary key value*/ primaryKeyValue: string; /** @description datastore put [item details] */ - putItem: string; + putItem: object; /** @description datastore query [expression] */ queryExpression: string; /** @description datastore query [expression expression_values] */ - queryExpressionValues: string; + queryExpressionValues: object; } /**