Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-docblock-runner

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-docblock-runner

Run specific Jest tests by tagging your tests with docBlock pragmas.

  • 1.3.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

jest-docblock-runner

npm version jest Lint-Build-Test-Publish XO code style semantic-release License: MIT

Run Jest tests by docBlock pragmas like those used in jest-circus-allure-environment

🚧 This is currently under development. 🚧

➕ Jest patches

This project is contingent on code changes to be approved and merged into the Jest project. For now I've implemented a workaround that applies patches to the Jest dependencies using patch-package. This should happen automatically after installing the dependencies with yarn install /npm install.

If for some reason the patches were not applied automatically you can apply them by running:

npx patch-package --patch-dir="./node_modules/jest-docblock-runner/patches"

🚀 Quick start

  1. Add dependency to project
yarn add --dev jest-docblock-runner
  1. Apply the patches to jest-circus, jest-jasmine2, jest-types, and jest-runner
npx patch-package --patch-dir="./node_modules/jest-docblock-runner/patches"
  1. Update Jest configuration

See the Jest documentation for more information.

// Jest.config.js

{
  ...
  "runner": "jest-docblock-runner"
}
  1. Add DocBlock pragmas to your tests
// example.test.js

test('bank records update, when I withdraw $100 USD', () => {
  /**
   * @severity critical
   */

  ...
})
  1. Run specific marked tests
yarn run jest --severity=critical

Note: This will accept comma separated values and/or multiple flags.

TODO:

  • Get this Jest PR merged or work with the Jest team to implement another solution that resolves this issue.
  • Add support for describe blocks.
  • Reach 100% code coverage.

Keywords

FAQs

Package last updated on 23 Dec 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc