
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
@temporalio/nyc-test-coverage
Advanced tools
@temporalio/nyc-test-coverage
Temporal's TypeScript SDK integration for Workflow code coverage with nyc and similar tools.
npm install -D mocha nyc @temporalio/nyc-test-coverage
WorkflowCoverage
from this package, and call augmentWorkerOptions()
to configure Workflows to gather and export code coverage data:import { WorkflowCoverage } from '@temporalio/nyc-test-coverage';
const workflowCoverage = new WorkflowCoverage();
worker = await Worker.create(workflowCoverage.augmentWorkerOptions({
connection: nativeConnection,
taskQueue,
workflowsPath: require.resolve("./workflows"),
}));
mergeIntoGlobalCoverage()
to merge your Workflows' code coverage into nyc's global coverage.after(() => {
workflowCoverage.mergeIntoGlobalCoverage();
});
bundleWorkflowCode()
If you are pre-bundling your Workflows using bundleWorkflowCode()
, we recommend using the augmentBundleOptions()
method to configure your bundle options, followed by augmentWorkerOptionsWithBundle()
to configure your Worker options as follows.
const bundle = await bundleWorkflowCode(
workflowCoverage.augmentBundleOptions({
workflowsPath: require.resolve('./workflows'),
})
);
const worker = await Worker.create(
workflowCoverage.augmentWorkerOptionsWithBundle({
connection,
taskQueue,
workflowBundle: bundle,
activities,
})
);
With bundleWorkflowCode()
, you still need to call mergeIntoGlobalCoverage()
when your tests are done to merge Workflow test coverage into nyc's global test coverage.
after(() => {
workflowCoverage.mergeIntoGlobalCoverage();
});
This package also works with Jest code coverage.
However, this package only works with the default coverageProvider
option 'babel'
.
This package does not work with coverageProvider: 'v8'
.
Complete the following steps to use this package with Jest.
npm install jest @temporalio/nyc-test-coverage
coverageProvider
option is not set to 'v8'
. Set coverageProvider
to 'babel'
.WorkflowCoverage
from this package, and call augmentWorkerOptions()
to configure Workflows to gather and export code coverage data:import { WorkflowCoverage } from '@temporalio/nyc-test-coverage';
const workflowCoverage = new WorkflowCoverage();
worker = await Worker.create(workflowCoverage.augmentWorkerOptions({
connection: nativeConnection,
taskQueue,
workflowsPath: require.resolve("./workflows"),
}));
mergeIntoGlobalCoverage()
to merge your Workflows' code coverage into Jest's global coverage.afterAll(() => {
workflowCoverage.mergeIntoGlobalCoverage();
});
FAQs
Temporal.io SDK code coverage integration
The npm package @temporalio/nyc-test-coverage receives a total of 42,057 weekly downloads. As such, @temporalio/nyc-test-coverage popularity was classified as popular.
We found that @temporalio/nyc-test-coverage demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.