Gathering detailed insights and metrics for check-tests
Gathering detailed insights and metrics for check-tests
Gathering detailed insights and metrics for check-tests
Gathering detailed insights and metrics for check-tests
check-dts
Unit tests for .d.ts TypeScript definitions
is2
A type checking library where each exported function returns either true or false and does not throw. Also added tests.
matches-selector
Check if a DOM element matches a given selector, with decent browser support and unit tests.
jasmine-check
Generative property tests for Jasmine
npm install check-tests
Typescript
Module System
Node Version
NPM Version
0.12.0-beta.1
Updated on Jul 10, 2025
0.11.1
Updated on Jul 01, 2025
0.11
Updated on Jun 13, 2025
0.10.7-beta.1-exclude
Updated on Jun 11, 2025
0.10.6-beta-tests-update-id
Updated on Apr 23, 2025
0.10.5-beta-tests-update-id
Updated on Apr 10, 2025
JavaScript (97.93%)
TypeScript (2.04%)
Shell (0.02%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
20 Stars
406 Commits
7 Forks
6 Watchers
33 Branches
24 Contributors
Updated on Jul 10, 2025
Latest Version
0.11.1
Package Id
check-tests@0.11.1
Unpacked Size
117.84 kB
Size
26.86 kB
File Count
28
NPM Version
10.9.0
Node Version
22.12.0
Published on
Jul 01, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
14
GitHub Action with Static Analysis for your JavaScript tests.
This action shows changed tests on each pull request with a complete list of all tests in this project. You can create test document in wiki of the project.
Use this checker as
📖 Complete CLI Configuration Documentation - Detailed reference for all CLI options and environment variables
.only
exclusive tests🌀 Tests overview by Testomatio
Found 7 codeceptjs tests in 1 files
1+ @first Create Todos @step:06 @smoke @story:12345: Another test
1- @first Create Todos @step:06 @smoke @story:12345: Create multiple todo items
📎 @first
Create Todos @step:06
@smoke
@story:12345
tests
Once this action is enabled, bot will create a comment for each Pull Request with a list of all changed tests.
This information is useful to:
.only
exclusive testshas tests
or no tests
labelsCheck that your project uses one of the following testing frameworks (this list will be extended).
Supported testing frameworks
Add this action to your workflow file .github/workflow/main.yml
and configure.
1on: [push] 2 3jobs: 4 test: 5 runs-on: ubuntu-latest 6 name: Check Tests 7 steps: 8 - uses: actions/checkout@v2 9 with: 10 fetch-depth: 0 11 - uses: testomatio/check-tests@stable 12 with: 13 framework: # REQUIRED - testing framework 14 tests: # REQUIRED - glob pattern to match test files 15 token: ${{ secrets.GITHUB_TOKEN }}
It is important to enable
actions/checkout@v2
step withfetch-depth: 0
to allow testomatio to compare tests in pull requests with tests in base.
framework
- (required) Test framework to be used. Supported: mocha, codeceptjs'tests
- (required) Glob pattern to match tests in a project, example: tests/**_test.js'
token
- (should be: ${{ secrets.GITHUB_TOKEN }}
) GitHub token to post comment with summary to current pull requesttypescript
- enable TypeScript supporthas-tests-label
- add a label when PR contains new tests. Set true
or a label name to enable.no-tests-label
- add a label when PR contains no new tests. Set true
or a label name to enable.comment-on-empty
- post a comment to PR when no tests added. Can be either boolean (for neutral message) or a custom message within a comment (markdown supported)close-on-empty
- close PR when no tests added. Use with comment-on-empty
to clarify this actioncomment-on-skipped
- add custom message when new tests are skipped (markdown supported).close-on-skipped
- close PR when introduced skipped tests. Use with comment-on-skipped
to clarify this actionenable-documentation
- If set to true
, test document will be created in wiki.wiki-doc-name
- Name of the wiki document. By default it will use Test Document
documentation-branch
- Branch to create document on push. Uses default branch if this field is emptygithub-pat
- Github Private access token to create document in wiki.This example uses jest as example. Tests are located in tests/
directory. You can generate GH_PAT here and add the generated token in secrets of your repo.
If documentation branch is not provided, it will consider default branch of the repo.
1steps: 2 - uses: actions/checkout@v2 3 with: 4 fetch-depth: 0 5 - uses: actions/setup-node@v1 6 with: 7 node-version: '12' 8 - run: npm install 9 - uses: testomatio/check-tests@stable 10 with: 11 framework: jest 12 tests: 'tests/*.spec.js' 13 token: ${{ secrets.GITHUB_TOKEN }} 14 github-pat: ${{ secrets.GH_PAT }} 15 enable-documentation: true 16 wiki-doc-name: 'Test-Document' 17 documentation-branch: 'doc-branch'
Jest tests located in tests/
directory:
1steps: 2 - uses: actions/checkout@v2 3 with: 4 fetch-depth: 0 5 - uses: testomatio/check-tests@stable 6 with: 7 framework: jest 8 tests: tests/**.spec.js 9 token: ${{ secrets.GITHUB_TOKEN }} 10 comment-on-empty: true 11 has-tests-label: true
Cypress.io tests located in cypress/integration
directory:
1steps: 2 - uses: actions/checkout@v2 3 with: 4 fetch-depth: 0 5 - uses: testomatio/check-tests@stable 6 with: 7 framework: cypress.io 8 tests: cypress/integration/**.js 9 token: ${{ secrets.GITHUB_TOKEN }} 10 comment-on-empty: true 11 has-tests-label: true
CodeceptJS tests located in tests
directory:
1steps: 2 - uses: actions/checkout@v2 3 with: 4 fetch-depth: 0 5 - uses: testomatio/check-tests@stable 6 with: 7 framework: codeceptjs 8 tests: tests/**_test.js 9 token: ${{ secrets.GITHUB_TOKEN }} 10 comment-on-empty: true 11 has-tests-label: true
Protractor tests located in spec
directory:
1steps: 2 - uses: actions/checkout@v2 3 with: 4 fetch-depth: 0 5 - uses: testomatio/check-tests@stable 6 with: 7 framework: protractor 8 tests: spec/**.spec.js 9 token: ${{ secrets.GITHUB_TOKEN }} 10 comment-on-empty: true 11 has-tests-label: true
Protractor tests located in spec
directory:
1steps: 2 - uses: actions/checkout@v2 3 with: 4 fetch-depth: 0 5 - uses: testomatio/check-tests@stable 6 with: 7 framework: protractor 8 tests: spec/**.spec.ts 9 token: ${{ secrets.GITHUB_TOKEN }} 10 typescript: true
Mocha tests located in tests/
directory:
1steps: 2 - uses: actions/checkout@v2 3 with: 4 fetch-depth: 0 5 - uses: testomatio/check-tests@stable 6 with: 7 framework: mocha 8 tests: tests/**_test.js 9 token: ${{ secrets.GITHUB_TOKEN }} 10 no-tests-label: Tests Needed
Testcafe tests located in tests/
directory:
1steps: 2 - uses: actions/checkout@v2 3 with: 4 fetch-depth: 0 5 - uses: testomatio/check-tests@stable 6 with: 7 framework: testcafe 8 tests: tests/**/*.js 9 token: ${{ secrets.GITHUB_TOKEN }} 10 no-tests-label: Tests Needed
TESTOMATIO={apiKey} npx check-tests newman "your_collection_name.json"
or
TESTOMATIO={apiKey} npx check-tests newman "folder_with_collections/*.json"
When PR doesn't contain tests - close it and write a message
1steps: 2 - uses: actions/checkout@v2 3 with: 4 fetch-depth: 0 5 - uses: testomatio/check-tests@stable 6 with: 7 framework: protractor 8 tests: spec/**_spec.js 9 token: ${{ secrets.GITHUB_TOKEN }} 10 comment-on-empty: '## PRs without tests not allowed' 11 close-on-empty: true
When PR contains skipped tests - close it and write a message
1steps: 2 - uses: actions/checkout@v2 3 with: 4 fetch-depth: 0 5 - uses: testomatio/check-tests@stable 6 with: 7 framework: protractor 8 tests: spec/**_spec.js 9 token: ${{ secrets.GITHUB_TOKEN }} 10 comment-on-skipped: "## Don't mark tests as skipped!" 11 close-on-skipped: true
Use this checker as CLI tool with any Continuous Integration service.
Run check-tests
via npx:
1npx check-tests <framework> "<tests>" --no-skipped
To change host of endpoint for receiving data, and set it to other than app.testomat.io use TESTOMATIO_URL environment variable:
TESTOMATIO_URL=http://local.testomat.io
This checker will fail a build if exclusive tests (with
.only
orfit
orfdescribe
found)
tests/**_test.js'
. It is important to include glob pattern in double quotes "
so wildcard could be used correctly.--no-skipped
- fail when skipped tests found--typescript
- enable typescript support-g, --generate-file <fileName>
- Export test details to document-u, --url <url>
, Github URL to get file link (URL/tree/master)Check tests for CodeceptJS
npx check-tests codeceptjs "tests/**_test.js"
Check tests for Protractor
npx check-tests protractor "spec/**.spec.js"
Check tests for Protractor with TypeScript
npx check-tests protractor "spec/**.spec.ts" --typescript
Check tests for Cypress.io
npx check-tests cypress "cypress/integration/**.js"
Check tests for Testcafe
npx check-tests testcafe "tests/**.js"
List CodeceptJS tests
When found .only
test:
✗ npx check-tests mocha "test/**/**_test.js"
[[ Tests checker by testomat.io ]]
Error: Exclusive tests detected. `.only` call found in test/checkout/important_test.js:290
Remove `.only` to restore test checks
This library is used by Testomatio to import tests.
Use TESTOMATIO
environment variable with a valid API key to import data into a project.
API key can be obtained on project settings page or on "Import From Source" page.
For example:
TESTOMATIO=11111111 npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js"
By default, check-test sends the code of the test hooks to the "client": before, beforeEach and after. In the "Codes" section you can see all the additional "context" of the test (Testomat.io).
To exclude hook code from a client test, use the --no-hooks option
TESTOMATIO=11111111 npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js" --no-hooks
To include line number code from a client test, use --line-numbers option. (By default Code section exclude "line number")
TESTOMATIO=11111111 npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js" --line-numbers
It is possible to import parametrized tests if they use template literals with variables in thier names:
1['one', 'two', 'three'].forEach(() => { 2 it(`this is test number ${parameter}`); 3});
This test will be imported with its original name including a placeholder:
this is test number ${parameter}
When executed test will be reported with 3 results matched to the same test and param values will be added to the report.
If a test from a previous import was not found on next import it is marked as "detached". This is done to ensure that deleted tests are not staying in Testomatio while deleted in codebase.
To disable this behavior and don't mark anything on detached on import use --no-detached
option
TESTOMATIO=11111111 npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js" --no-detached
This option could also be set via environment variable TESTOMATIO_NO_DETACHED=1
.
If you don't want to pass it each time, create .env file in the root dir of your project with this variable set.
By default check-tests
doesn't wait for all tests to be processed. It sends request to Testomatio and exits. To wait for processing to finish use --sync
option.
TESTOMATIO=11111111 npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js" --sync
Please note, that this will take a long time on a large codebase.
To disable guess matching for tests it is recommend to use Testomatio IDs to map a test in source code to a test in Testomatio. Testomatio IDs can be put automatically into the test names into source code when --update-ids
option is used:
TESTOMATIO=11111111 npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js" --update-ids
Tests imported with --update-ids
will be processed in synchronouse mode, so the script will finish after all tests are processed.
To import tests with Test IDs set in source code into another project use --create
option. In this case, a new project will be populated with the same Test IDs.
TESTOMATIO=11111111 npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js" --create
Without --create
import will fail with a message that ID was not found.
If you want to import the synced project as new project, you have to clean the test ids.
To clean up test ids without connecting to Testomatio project use --purge
option:
npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js" --purge
This method may be unsafe, as it cleans all @S*
and @T*
tags from tests and suites. So if you have a tag like @Test1234
this may also be removed. If you use this option make sure if all the test titles a proper before committing the tests in GIT.
Note:
--purge
is an alias of--unsafe-clean-ids
option.
To clean only test ids set from a specific project use --clean-ids
option instead:
TESTOMATIO=11111111 npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js" --clean-ids
TESTOMATIO is API key of a project with existing test ids.
Tests can be imported into a specific branch if TESTOMATIO_BRANCH
parameter is used.
Branch is matched by its id. If branch was not found, it will be created.
TESTOMATIO_BRANCH=dev TESTOMATIO=1111111 npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js"
When tests in source code have IDs assigned and those tests are imported, Testomat.io uses current structure in a project to put the tests in. If folders in source code doesn't match folders in Testomat.io project, existing structure in source code will be ignored. To force using the structure from the source code, use --keep-structure
flag on import:
TESTOMATIO=1111111 npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js" --keep-structure
If tests were marked with IDs and imported to already created suites in Testomat.io
newly imported suites may become empty. Use --no-empty
option to clean them up after import.
TESTOMATIO=1111111 npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js" --no-empty
This prevents usage --keep-structure option.
To put all imported tests into a specific suite (folder) pass in TESTOMATIO_PREPEND_DIR
environment variable:
TESTOMATIO_PREPEND_DIR="MyTESTS" TESTOMATIO=1111111 npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js"
This will use "MyTests" folder in a root of a project or create it if it doesn't exist.
It is also possible to specify a suite by its SID:
TESTOMATIO_SUITE="1111111" TESTOMATIO=1111111 npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js"
or use SID with prefix:
TESTOMATIO_SUITE="S1111111" TESTOMATIO=1111111 npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js"
TESTOMATIO_SUITE="@S1111111" TESTOMATIO=1111111 npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js"
Use TESTOMATIO_LABELS
to tag all imported tests with labels:
1# Apply single label 2TESTOMATIO_LABELS="smoke" TESTOMATIO=1111111 npx check-tests jest "tests/**/*.test.js" 3 4# Apply multiple labels (comma-separated) 5TESTOMATIO_LABELS="smoke,regression,api" TESTOMATIO=1111111 npx check-tests playwright "tests/**/*.spec.ts" 6 7# Apply labels with values using label:value format 8TESTOMATIO_LABELS="severity:high,feature:user_account,team:backend" TESTOMATIO=1111111 npx check-tests jest "tests/**/*.test.js" 9 10# Mix simple labels and label:value pairs 11TESTOMATIO_LABELS="smoke,severity:critical,feature:auth,regression" TESTOMATIO=1111111 npx check-tests playwright "tests/**/*.spec.ts" 12 13# Use alias for Python SDK compatibility 14TESTOMATIO_SYNC_LABELS="integration,e2e" TESTOMATIO=1111111 npx check-tests cypress "cypress/integration/**/*.js"
Use TESTOMATIO_WORKDIR
to avoid redundant folder nesting:
1# Problem: src/tests/API/ creates nested paths in Testomat.io 2# Solution: Set working directory to remove src/tests prefix 3TESTOMATIO_WORKDIR=src/tests TESTOMATIO=1111111 npx check-tests playwright "**/*.spec.ts" 4 5# Monorepo: Import without parent paths 6TESTOMATIO_WORKDIR=apps/frontend TESTOMATIO=1111111 npx check-tests jest "**/*.test.js"
Use TESTOMATIO_PREPEND_DIR
to organize tests:
1# Group API tests under "API Tests" folder 2TESTOMATIO_PREPEND_DIR="API Tests" TESTOMATIO=1111111 npx check-tests jest "src/api/**/*.test.js" 3 4# Separate by team 5TESTOMATIO_PREPEND_DIR="Frontend Team" TESTOMATIO=1111111 npx check-tests playwright "tests/ui/**/*.spec.ts"
Use TESTOMATIO_SUITE
to target existing suites:
1# Import to existing suite by SID 2TESTOMATIO_SUITE=S1234567 TESTOMATIO=1111111 npx check-tests jest "features/**/*.test.js"
For TypeScript projects @babel/core
and @babel/plugin-transform-typescript
packages are used. GitHub Action already contains those modules, while CLI version of this tool tries to automatically install them on first run.
If you face issues parsing TypeScript file menitioning @babel/core
or @babel/plugin-transform-typescript
try to install them manually:
npm i @babel/core @babel/plugin-transform-typescript --save-dev
Now tests TypeScript can be imported with --typescript
option:
TESTOMATIO=11111111 npx check-tests CodeceptJS "**/*{.,_}{test,spec}.js" --typescript
Test aliases are used to map tests in source code to tests in Testomat.io. By default test
and it
are parsed. But if you rename them or use another function to define tests (e.g. created/extended test object in Playwright), you can add alias (or multiple aliases, separated by comma) via --test-alias
option:
TESTOMATIO=11111111 npx check-tests Playwright "**/*{.,_}{test,spec}.ts" --test-alias myTest,myCustomFunction
Import Analyzer from module:
1const { Analyzer } = require('check-tests'); 2 3const framework = 'jest'; 4const pathToTests = './tests'; 5const pattern = '**/*[._-]{test,spec}.{ts,js}'; 6 7const analyzer = new Analyzer(framework, pathToTests); 8 9// to enable typescript... 10analyzer.withTypeScript(); 11 12// to enable babel plugins 13analyzer.addPlugin('@babel/plugin-syntax-jsx'); 14analyzer.addPlugin('@babel/plugin-syntax-flow'); 15 16// to enable babel presets 17analyzer.addPreset('@babel/preset-react'); 18analyzer.addPreset('@babel/preset-flow'); 19 20analyzer.analyze(pattern); 21 22// stats on processed files 23const stats = analyzer.stats; 24 25// full info on parsed tests 26const data = analyzer.rawTests;
Run import with DEBUG="testomatio:*"
environment variable to get additional logs which may help understanding the cause of an issue. Usually it may happen because of a specific file that couldn't be parsed:
DEBUG="testomatio:*" npx check-tests@latest ....
API Endpoint to import test data into Testomat.io:
Part of Testomat.io
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
9 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 7
Reason
3 existing vulnerabilities detected
Details
Reason
Found 16/29 approved changesets -- score normalized to 5
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
license file not detected
Details
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More