Skip to main content

A SpecSync plugin that synchronizes TypeScript Jest tests as Test Cases.

Total Downloads
7.2K
7,172
Published
Jun 10, 2026
5mo ago

Get Started

dotnet add package SpecSync.Plugin.JestTestSource --version 5.2.1
ProductVersions
.NET Standard
netstandard2.0

README

Jest Test Source SpecSync Plugin: SpecSync.Plugin.JestTestSource

Allows synchronizing TypeScript Jest tests and publishing Jest JSON test result files.

You can find more information about the SpecSync sample plugins in the repository page.

The plugin requires a SpecSync Enterprise license to run. Please contact us to get an evaluation license.

Synchronizing TypeScript Jest tests

The plugin scans configured TypeScript source files (for example src/**/*.test.ts) and parses Jest test declarations.

It supports:

  • JavaScript (.js), TypeScript (.ts), JSX (.jsx) and TSX (.tsx) files
  • test(...) and it(...)
  • describe blocks including nested describes
  • common Jest extensions, e.g. describe.each, describe.only, test.concurrent, test.only, test.todo
  • parameterized tests with .each(...)

Example:

import { sum } from "./sum";

describe("sum utility [@describeTag]", () => {
  test("adds two numbers [@tc:251 @testTag]", () => {
    expect(sum(2, 3)).toBe(5);
  });

  test.each([
    [1, 2, 3],
    [0, 0, 0],
    [-3, 7, 4],
  ])("adds %i and %i to equal %i [@tc:262]", (left: number, right: number, expected: number) => {
    expect(sum(left, right)).toBe(expected);
  });
});

// top-level test is also supported
test("adds two numbers (top level) [@tc:264]", () => {
  expect(sum(2, 3)).toBe(5);
});

SpecSync tags in Jest test titles

SpecSync tags are read from tag blocks in test and describe titles, for example:

  • [@tc:251] to link to a Test Case
  • [@story:123] to link to another work item
  • custom tags like [@important]

Describe tags are inherited by nested tests.

Example configuration

Sample specsync.json highlights:

{
  "toolSettings": {
    "plugins": [
      {
        "packageId": "SpecSync.Plugin.JestTestSource",
        "packageVersion": "5.0.0"
      }
    ]
  },
  "local": {
    "folder": "src",
    "sourceFiles": [
      "src/**/*.test.ts"
    ]
  },
  "synchronization": {
    "links": [
      {
        "tagPrefix": "story"
      }
    ],
    "automation": {
      "enabled": true,
      "automatedTestType": "Jest Unit Test"
    },
    "fieldUpdates": {
      "Description": "<b>describe: {rule-name}</b>{br:HTML}<pre>{local-test-case-container-source-file-path:HtmlEncode}:{br}{local-test-case-source:HtmlEncode}</pre>"
    }
  }
}

Publishing test results

The plugin publishes Jest execution results from Jest JSON output.

Supported format:

  • JestJson

Generate Jest JSON, e.g.:

npx jest --json --outputFile=jest-results.json

Publish results with SpecSync:

dotnet specsync publish-test-results -r .\jest-results.json -f JestJson

The sample project contains a result file example at SampleProject/jest-results.json.

Downloads by Version

Similar & Alternative Packages

Hand-picked matching NuGet libraries based on tags & ecosystem

Depended On By

Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.