Skip to content

Commit d068b4e

Browse files
rogerthatdevmuncus
andauthored
feat(workflows): add test to workflow quickstart for optional parameter (#3403)
* feat: test workflow quickstart for optional param * Update workflows/quickstart/test/quickstart.test.ts Co-authored-by: Marc Dougherty <[email protected]> --------- Co-authored-by: Marc Dougherty <[email protected]>
1 parent a07d704 commit d068b4e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

workflows/quickstart/test/quickstart.test.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const execSync = (cmd: string) => cp.execSync(cmd, {encoding: 'utf-8'});
2323
const PROJECT_ID = process.env.GOOGLE_CLOUD_PROJECT as string;
2424
const LOCATION_ID = 'us-central1';
2525
const WORKFLOW_ID = 'myFirstWorkflow';
26+
const SEARCH_TERM = 'cloud';
2627

2728
describe('Cloud Workflows Quickstart Tests', () => {
2829
before(async () => {
@@ -67,7 +68,7 @@ describe('Cloud Workflows Quickstart Tests', () => {
6768
}
6869
});
6970

70-
it('should execute the quickstart', async () => {
71+
it('should execute the quickstart without optional search term', async () => {
7172
// Execute workflow, with long test timeout
7273
const result = execSync(
7374
`node --loader ts-node/esm ./index.ts ${PROJECT_ID} ${LOCATION_ID} ${WORKFLOW_ID}`
@@ -79,4 +80,17 @@ describe('Cloud Workflows Quickstart Tests', () => {
7980
'Quickstart must return non-empty result'
8081
);
8182
}).timeout(5000);
83+
84+
it('should execute the quickstart with optional search term', async () => {
85+
// Execute workflow, with long test timeout
86+
const result = execSync(
87+
`node --loader ts-node/esm ./index.ts ${PROJECT_ID} ${LOCATION_ID} ${WORKFLOW_ID} ${SEARCH_TERM}`
88+
);
89+
90+
assert.strictEqual(
91+
result.length > 0,
92+
true,
93+
'Quickstart must return non-empty result'
94+
);
95+
}).timeout(5000);
8296
});

0 commit comments

Comments
 (0)