Skip to content

Commit

Permalink
updated data type
Browse files Browse the repository at this point in the history
  • Loading branch information
cchensh committed Sep 27, 2024
1 parent 1198cef commit b47b70a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions packages/cli-test/src/cli/commands/datastore.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`),
Expand All @@ -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`));
});
});
Expand Down
4 changes: 2 additions & 2 deletions packages/cli-test/src/cli/commands/datastore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit b47b70a

Please sign in to comment.