Skip to content

Commit

Permalink
refactor sample doc
Browse files Browse the repository at this point in the history
  • Loading branch information
alkatrivedi committed May 30, 2024
1 parent dbcad46 commit 9780005
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
4 changes: 4 additions & 0 deletions samples/batch-write.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
* limitations under the License.
*/

// sample-metadata:
// title: Performs batch write operation.
// usage: node batch-write.js <INSTANCE_ID> <DATABASE_ID> <PROJECT_ID>

'use strict';

async function main(
Expand Down
24 changes: 12 additions & 12 deletions samples/system-test/spanner.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,18 +827,6 @@ describe('Autogenerated Admin Clients', () => {
);
});

// batch_write
it('should perform CRUD operations using batch write', async () => {
const output = execSync(
`${batchWriteCmd} ${INSTANCE_ID} ${DATABASE_ID} ${PROJECT_ID}`
).toString();
assert.match(
output,
/Mutation group indexes [\d,]+ have been applied with commit timestamp \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z/
);
assert.include(output, 'Mutations applied successfully');
});

// dml_standard_insert
it('should insert rows into an example table using a DML statement', async () => {
const output = execSync(
Expand Down Expand Up @@ -980,6 +968,18 @@ describe('Autogenerated Admin Clients', () => {
assert.match(output, new RegExp('Virginia Watson'));
});

// batch_write
it('should perform CRUD operations using batch write', async () => {
const output = execSync(
`${batchWriteCmd} ${INSTANCE_ID} ${DATABASE_ID} ${PROJECT_ID}`
).toString();
assert.match(
output,
/Mutation group indexes [\d,]+ have been applied with commit timestamp \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z/
);
assert.include(output, 'Mutations applied successfully');
});

// create_table_with_datatypes
it('should create Venues example table with supported datatype columns', async () => {
const output = execSync(
Expand Down

0 comments on commit 9780005

Please sign in to comment.