This sample shows use cases for Activities:
makeHTTPRequest: Make an external HTTP request in an Activity (usingaxios).cancellableFetch: Make a cancellable HTTP request with cancellationSignal.doSomethingAsync: Complete an Activity async withAsyncCompletionClient.
More Activity samples are listed here.
- Mocha: Run the tests in
src/mocha/with:npm test: run oncenpm run test.watch: run when files changenpm run test.coverage: run with coverage report
- Jest:
npm run jestruns tests outside themocha/directory:
temporal server start-devto start Temporal Server.npm installto install dependencies.npm run start.watchto start the Worker.- In another shell,
npm run workflowto run the Workflow.
The Workflow should make an HTTP request to httpbin.org and then return:
The answer is 42