New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tslint-no-focused-test

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tslint-no-focused-test

Custom TSLint plugin to check for focused tests

  • 0.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.5K
decreased by-0.56%
Maintainers
1
Weekly downloads
 
Created
Source

🔬 tslint-no-focused-test

This is a custom TSLint rule that checks for the following focused tests:

  • fit
  • fdescribe
  • it.only
  • describe.only
  • context.only
  • test.only

The intended use case is as a pre-commit hook or build (CI/CD) task.

📝 Install

Install the package with

npm install tslint-no-focused-test --save-dev (or yarn add tslint-no-focused-test --save-dev).

Then add the following to your tslint.json:

  "rulesDirectory": [
    "tslint-no-focused-test"
  ],
  "rules": {
    "no-focused-test": true
  }

📖 Examples

↩️ Pre-commit hook example

Install husky and lint-staged and save to development dependencies. Then configure in your package.json:

  "scripts": {
    "precommit": "lint-staged"
  },
  "lint-staged": {
    "*.ts": ["tslint -c tslint.json 'test/**/*.test.ts'"]
  }
📦 Build task example

E.g. as a step in a job for a CircleCI build:

version: 2
jobs:
  build-app:
    docker:
      - image: node:6
    steps:
      - run:
          name: lint:tests
          command: npm run lint:tests

where the "scripts" option of the package.json has

"lint:tests": "tslint -c tslint.json 'test/**/*.test.ts'"

Keywords

FAQs

Package last updated on 22 Nov 2018

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