1.0.2 • Published 1 month ago

skipped-tests-finder v1.0.2

Weekly downloads
-
License
GNU General Publi...
Repository
-
Last release
1 month ago

skipped-tests-finder

Analyses your project or a specific directory for skipped tests

Skipped Tests Finder is a command-line tool that scans your project or test suite and identifies any skipped tests or test suites. It provides a convenient way to keep track of skipped tests and ensure that they are addressed before releasing your application. Skipped Tests Finder works for the majority of test frameworks, including but not limited to Playwright, Puppeteer, Cypress, Robot Framework, Selenium, Katalon Studio, Jest, Mocha, Jasmine, unittest, pytest, RSpec, MiniTest, PHPUnit, JUnit, NUnit, MSTest, Catch2 and GoogleTest.

Note: this tool does not seem to work with scanning the entirety of very large codebases, so if you get the error: The directory does not exist. Please enter a valid directory path. after running this tool to scan your entire codebase, then please run it again, against the directory of your test or src folder. It is better as well, that you run this tool against seperate directories to seperate the results for different types of test suites that your project might contain for e.g. Jest tests in ./src and Cypress tests in ./cypress/e2e.

Features

  • Recursively scans a directory and its subdirectories for test files (.js, .ts, .jsx, .tsx, .coffee, .py, .rb, .php, .java, .cs, .go, .cpp and .groovy files)
  • Identifies skipped tests for many different types of syntaxes, such as it.skip(...), test.skip(...), xtest(...), @unittest.skip("reason"), @pytest.mark.skip(reason="reason"), it "test name", :skip => "reason" do ... end, def test_...; skip "reason"; ... ; end, @Ignore("reason"), @Disabled("reason"), [Ignore("reason")], [IgnoreAttribute("reason")], SKIP_TEST("reason"), DISABLED_TEST(TestSuiteName, TestName) { ... }, @IgnoreTest, and skipped test suites using xdescribe(...), test.skip.describe(...), describe.skip(...) and .xscenario(...)
  • Displays the total number of skipped tests found
  • Outputs a list of skipped tests with their names, file paths, and line numbers
  • Supports outputting the results to a file (skipped-tests.txt) for easier integration with other tools or further processing

Installation

You can get skipped-tests-finder via npm by either adding it as a new devDependency to your package.json file and running npm install, or running the following command:

npm install skipped-tests-finder --save-dev

Requirements

  • skipped-tests-finder requires NodeJS 10 (or higher) to be installed

Usage

  1. Navigate to the root directory of your project.
  2. Install skipped-tests-finder.
  3. Run the skipped-tests-finder command:
npm run skipped-tests-finder
  1. The script will prompt you to enter the path to your tests directory. You can either provide the path after running the script or before by using the argument -d, for e.g. npm skipped-tests-finder -d=cypress/e2e
  2. The script will then ask if you want to output the results to a text file. Enter y or n accordingly. Or use one of the following arguments when running the script and to skip the prompt: -cli or -txt, -cli will print out the output of the results to your console and -txt will print out the output of the results to a plain text file (skipped-tests.txt).
  3. The script will scan your test directory and its subdirectories for skipped tests and display the results in the console or write them to the skipped-tests.txt file, depending on your choice.

Commands

Usage: skipped-tests-finder [options] -d=[<path>]

Options:

 -d=              Path to the directory to search for skipped tests
 -txt             Output the results to a plain text file
 -cli             Output the results to the terminal
 -h, --help       Display this help message

Example Output

my-name@my-computers-name my application % npm skipped-tests-finder -d=./cypress/e2e -cli

Total skipped tests: 2

Skipped Tests:

- test 1 (cypress/e2e/tests.spec.js:4)
- test 2 (cypress/e2e/tests.spec.js:12)

Contributing

Pull requests are welcomed. For major changes, please open an issue first to discuss what you would like to change.

Contact

Shubham Sharma - My LinkedIn - shubhamsharma.emails@gmail.com.

License

This project is licensed under the GPL 3.0 License - see the LICENSE file for details.