Nuclear Pumpkin Mocha

    jest-xunit

    1.0.11 • Public • Published

    Jest XUnit

    jest-xunit is a reporter for Jest that produces an XML in xunit format.

    Installation

    npm i -D jest-xunit
    

    Then in your jest config specify jest-xunit as a reporter:

    {
      ...
      reporters: [
            'default', // keep the default reporter
            [
                'jest-xunit',
                {
                    traitsRegex: [
                        { regex: /\(Test Type:([^,)]+)(,|\)).*/g, name: 'Category' },
                        { regex: /.*Test Traits: ([^)]+)\).*/g, name: 'Type' }
                    ]
                }
            ]
        ]
      ...
    }

    Config

    configKey Description Default
    filename The filename of the results. The reporter outputs xml format test-results.xml
    outputPath The path where the test results should be generated. process.cwd()
    traitsRegex An array of objects with the following keys: _ regex - A regex to be used to extract the traits _ name - The name of the extract trait type []

    Install

    npm i jest-xunit

    DownloadsWeekly Downloads

    1,387

    Version

    1.0.11

    License

    MIT

    Unpacked Size

    6.19 kB

    Total Files

    3

    Last publish

    Collaborators

    • sscaff1