Skip to content

Conversation

@DenysKuchma
Copy link
Contributor

Add unit test at getAllSuiteTags util

@github-actions
Copy link

🌀 Tests overview by Testomatio

Found 229 mocha tests in 25 files

✔️ Added 6 tests

+ util functions: #getAllSuiteTags: should return empty array when no suites provided
+ util functions: #getAllSuiteTags: should return empty array when suites have no tags
+ util functions: #getAllSuiteTags: should collect tags from a single suite
+ util functions: #getAllSuiteTags: should collect tags from multiple suites
+ util functions: #getAllSuiteTags: should handle mixed suites with and without tags
+ util functions: #getAllSuiteTags: should not modify original suites array
📑 List all tests

📝 tests/analyzer_test.js

  • 📎 analyzer
    • ✔️ can import analyzer from main index
    • ✔️ should parse all mocha files
    • ✔️ should parse all typescript files
    • ✔️ should exclude dir in file name if dir specified
    • ✔️ should include full dir in file name
    • ✔️ should avoid node_modules
    • ✔️ should read char`
    • ✔️ should not load dirs as files
    • ✔️ should exclude files matching exclude pattern
    • ✔️ should exclude specific file patterns
    • ✔️ should work without exclude option
    • 📎 env variable params
      • ✔️ should prepend a dir from env variable
      • ✔️ should parse TypeScript files with ES2023 Explicit Resource Management

📝 tests/codeceptjs_test.js

  • 📎 codeceptjs parser
    • 📎 create todo tests
      • ✔️ should parse codecept file
      • ✔️ should include code
    • 📎 Parse CodeceptJS tags
      • ✔️ should include tags
    • 📎 Parse CodeceptJS tags & datatable
      • ✔️ should include data and tags
    • 📎 Parse CodeceptJS hooks code - default opts
      • ✔️ should include Before hook code
      • ✔️ should include BeforeSuite hook code
      • ✔️ should include AfterSuite hook code
    • 📎 [opts.noHooks = true] Parse CodeceptJS hooks code
      • ✔️ should exclude Before hook code
      • ✔️ should exclude BeforeSuite hook code
      • ✔️ should exclude AfterSuite hook code
    • 📎 Parse CodeceptJS test with --line-numbers option
      • ✔️ [lineNumbers=true opts] each section should include line-number as part of code section
      • ✔️ [no SET the lineNumbers opts] should exclude line-number
      • ✔️ [noHooks=true + lineNumbers=true opts] line-number as part of code section

📝 tests/comment_test.js

  • 📎 Comment
    • ✔️ should refer to proper skipped line in comment

📝 tests/decorator_test.js

  • 📎 Decorator
    • ✔️ should print markdown
    • ✔️ should validate tests with empty titles
    • ✔️ should print markdown2

📝 tests/gauge_test.js

  • 📎 gauge parser
    • 📎 basic gauge specs
      • ✔️ should parse specification title as suite
      • ✔️ should parse scenarios as tests
      • ✔️ should extract steps as test code
      • ✔️ should handle line numbers correctly
    • 📎 gauge specs with tags
      • ✔️ should handle tags correctly
      • ✔️ should parse multiple scenarios with tags
      • ✔️ should include tables in test code
    • 📎 gauge specs with alternative format
      • ✔️ should parse underlined specification title
      • ✔️ should handle scenario tags
    • 📎 edge cases
      • ✔️ should handle empty file
      • ✔️ should handle file with only specification
      • ✔️ should handle file with no tags
    • 📎 with options
      • ✔️ should respect noHooks option
      • ✔️ should respect lineNumbers option

📝 tests/jasmine_test.js

  • 📎 jasmine parser
    • 📎 jasmine tests
      • ✔️ should parse jasmine file
      • ✔️ should include code

📝 tests/jest_test.js

  • 📎 jest parser
    • 📎 jest tests
      • ✔️ should parse jest file
      • ✔️ should include code
    • 📎 exclusive tests
      • ✔️ should throw an error if a file contains .only
    • 📎 hooks tests - default opts
      • ✔️ should include beforeAll hook code
      • ✔️ should include beforeEach hook code
      • ✔️ should include afterAll hook code
    • 📎 [opts.noHooks = true] hooks tests
      • ✔️ should exclude beforeAll hook code
      • ✔️ should exclude beforeEach hook code
      • ✔️ should exclude after hook code
    • 📎 test with --line-numbers option
      • ✔️ [lineNumbers=true opts] each section should include line-number as part of code section
      • ✔️ [no SET the lineNumbers opts] should exclude line-number
      • ✔️ [noHooks=true + lineNumbers=true opts] line-number as part of code section
    • 📎 jest concurrent
      • ✔️ shuld parse it.concurrent
      • ✔️ should parse test.concurrent
    • 📎 ES2023 Explicit Resource Management tests
      • ✔️ should parse jest file with using keyword without errors
      • ✔️ should find test with using declaration
      • ✔️ should include code with using keyword

📝 tests/manual_test.js

  • 📎 manual (markdown) parser
    • 📎 markdown manual tests
      • ✔️ should parse markdown file
      • ✔️ should extract suite information
      • ✔️ should mark tests as manual
      • ✔️ should include test metadata
      • ✔️ should not include test content in code property
      • ✔️ should set correct line numbers

📝 tests/mocha_test.js

  • 📎 mocha parser
    • 📎 mocha tests
      • ✔️ should parse mocha file
    • 📎 cypress tests
      • ✔️ should parse cypress file
      • ✔️ should include code
    • 📎 graphql tests
      • ✔️ should parse codeceptjs internal test
    • 📎 Cypress: hooks tests
      • ✔️ should include before hook code by default
      • ✔️ should include beforeEach hook code by default
      • ✔️ should include after hook code by default
    • 📎 [opts.noHooks = true] Cypress: hooks code
      • ✔️ should exclude before hook code
      • ✔️ should exclude beforeEach hook code
      • ✔️ should exclude after hook code
    • 📎 Cypress: test with --line-numbers option
      • ✔️ [lineNumbers=true opts] each section should include line-number as part of code section
      • ✔️ [no SET the lineNumbers opts] should exclude line-number
      • ✔️ [noHooks=true + lineNumbers=true opts] line-number as part of code section

📝 tests/newman_test.js

  • 📎 newman parser
    • ✔️ should parse newman collection
    • ✔️ should properly get test name
    • ✔️ should properly get suites for test inside nested folder
    • ✔️ should properly get suite for test within collection (not in any folder)

📝 tests/nightwatch_test.js

  • 📎 nightwatch parser
    • ✔️ should parse basic nightwatch describe/it tests
    • ✔️ should parse mixed patterns with skipped tests
    • ✔️ should parse module.exports pattern (JavaScript)
    • ✔️ should parse TypeScript nightwatch tests with describe pattern
    • ✔️ should parse TypeScript nightwatch tests with hooks (ecosia example)
    • ✔️ should parse TypeScript nightwatch tests with module exports pattern
    • ✔️ should handle hooks correctly
    • ✔️ should forbid .only tests
    • ✔️ should handle no-hooks option
    • ✔️ should parse classic Nightwatch CommonJS syntax
    • ✔️ should parse page objects pattern
    • ✔️ should parse complex classical Nightwatch tests with hooks
    • ✔️ should handle @tags and metadata in classic syntax
    • ✔️ should handle classic Nightwatch with custom commands
    • ✔️ should parse classic Nightwatch ESM syntax
    • ✔️ should parse TypeScript Nightwatch export default pattern

📝 tests/playwright_test.js

  • 📎 playwright parser
    • ✔️ should parse basic playwright-js tests
    • ✔️ should forbid describe.only tests
    • ✔️ should parse basic playwright-ts tests
    • ✔️ should parse multiple playwright-js tests
    • ✔️ should parse multiple playwright-ts tests
    • ✔️ should update playwright suite if no suite set
    • 📎 tags
      • ✔️ should parse playwright-ts test with signle tag on the same line
      • ✔️ should parse playwright-ts test with opening brace on the same line and signle tag on the next line
      • ✔️ should parse playwright-ts test with signle tag on the next line
      • ✔️ should parse playwright-js test with multiple tags
      • ✔️ should parse playwright-js test with multiple tags on multiple lines
    • 📎 annotations
      • ✔️ should parse playwright test with single annotation
      • ✔️ should parse playwright test with multiple annotations
      • ✔️ should parse playwright-ts tests with params
      • ✔️ should parse playwright-js tests with annotation
      • ✔️ should parse playwright-js tests with annotation including fixme
      • ✔️ should parse playwright-ts tests with annotations
      • ✔️ should parse playwright test with test.skip annotation inside a test
      • ✔️ should parse playwright-js tests with skip() annotation for the description and test sections
      • ✔️ should parse playwright-js tests with fixme() annotation for the description and test sections
    • 📎 Parse Playwright hooks code - default opts
      • ✔️ should include beforeAll hook code
      • ✔️ should include beforeEach hook code
      • ✔️ should include afterAll hook code
    • 📎 [opts.noHooks = true] Parse Playwright hooks code
      • ✔️ should exclude beforeAll hook code
      • ✔️ should exclude beforeEach hook code
      • ✔️ should exclude afterAll hook code
    • 📎 **Default playwright file parsing **
      • ✔️ should parse basic playwright-ts DEMO tests ("todo" name as part of inner function args)
      • ✔️ should return suite name if used test.describe without parallel mode
      • ✔️ should return suite name if used test.describe.parallel mode
      • ✔️ should return suite name if used test.describe.serial mode
    • 📎 test with --line-numbers option
      • ✔️ [lineNumbers=true opts] each section should include line-number as part of code section
      • ✔️ [no SET the lineNumbers opts] should exclude line-number
      • ✔️ [noHooks=true + lineNumbers=true opts] line-number as part of code section
      • ✔️ should parse playwright test with custom alias (fixture/test name)

📝 tests/pull_test.js

  • 📎 Pull
    • 📎 pullFiles
      • ✔️ should create files from server response
      • ✔️ should create directories if they do not exist
      • ✔️ should overwrite existing files
      • ✔️ should handle empty files response
      • ✔️ should handle server errors
    • 📎 dry run mode
      • ✔️ should not create files in dry run mode
      • ✔️ should show what files would be created
    • 📎 file tree display
      • ✔️ should display file tree after successful pull
    • 📎 git checks
      • 📎 non-empty directory without git
        • ✔️ should exit with error when directory has files but no git
        • ✔️ should pass when directory is empty and no git
        • ✔️ should pass when directory has only hidden files and no git
      • 📎 git repository with dirty working tree
        • ✔️ should exit with error when working tree is dirty
        • ✔️ should pass when working tree is clean
      • 📎 force mode
        • ✔️ should bypass git checks with force mode
        • ✔️ should bypass dirty working tree check with force mode

📝 tests/push_command_test.js

  • 📎 push command
    • ✔️ should be available as a command
    • ✔️ should process markdown files like manual command
    • ✔️ should accept same options as main command
    • ✔️ should produce same output as manual command
    • ✔️ should handle directory option correctly
    • ✔️ should work with empty directory (finds tests in current project)

📝 tests/qunit_test.js

  • 📎 qunit parser
    • 📎 qunit tests
      • ✔️ should parse qunit file

📝 tests/testcafe_test.js

  • 📎 testcafe parser
    • 📎 Testcafe tests
      • ✔️ should parse testcafe file
      • ✔️ should include testcafe code

📝 tests/update_fs_test.js

  • 📎 UpdateIds FS
    • ✔️ should add suite and test ids
    • ✔️ should clean suite and test ids safely
    • ✔️ should clean suite and test ids unsafely

📝 tests/updateIds_codeceptjs_test.js

  • 📎 update ids tests(codeseptJS adapter)
    • 📎 [codeseptJS examples] includes Feature + Scenario
      • ✔️ [js file]: file includes Feature + one Scenario
      • ✔️ [js file]: test file does not include Feature, only Scenario
      • ✔️ [js file]: test file does not include Scenario, only Feature
    • 📎 [codeseptJS examples] clean-ids
      • ✔️ can remove ids from the file with Scenario only
      • ✔️ can remove ids form the Feature & Scenario

📝 tests/updateIds_gauge_test.js

  • 📎 Gauge update-ids
    • 📎 updateIdsGauge
      • ✔️ adds suite IDs to specification titles
      • ✔️ adds test IDs to scenario titles
      • ✔️ handles underlined specification titles
      • ✔️ handles underlined scenario titles
      • ✔️ prevents duplicate ID addition
      • ✔️ replaces previously added IDs (suite and tests)
      • ✔️ handles simple key matching
      • ✔️ handles tags in titles
    • 📎 cleanIdsGauge
      • ✔️ removes specific suite and test IDs
      • ✔️ removes all IDs in dangerous mode
      • ✔️ handles underlined format cleaning
      • ✔️ preserves original formatting when cleaning

📝 tests/updateIds_markdown_test.js

  • 📎 updateIds markdown
    • 📎 updateIdsMarkdown
      • ✔️ should add ID to test metadata
      • ✔️ should add ID to suite metadata
      • ✔️ should update existing ID
      • ✔️ should handle metadata without ID field
      • ✔️ should skip tests without metadata comment
    • 📎 cleanIdsMarkdown
      • ✔️ should remove ID from metadata
      • ✔️ should handle multiple IDs in file

📝 tests/updateIds_nightwatch_test.js

  • 📎 update ids for nightwatch
    • 📎 classical nightwatch format
      • ✔️ should update ids in classical nightwatch syntax
      • ✔️ should update ids in classical nightwatch with ESM syntax
    • 📎 describe/it nightwatch format
      • ✔️ should update ids in describe/it nightwatch syntax
    • 📎 clean ids
      • ✔️ should clean ids from classical nightwatch syntax
      • ✔️ should clean ids from describe/it nightwatch syntax

📝 tests/updateIds_playwright_test.js

  • 📎 update ids tests(playwright adapter)
    • 📎 [Playwright examples] includes/no includes main suite
      • ✔️ [ts file]: test file includes suite with tests
      • ✔️ [ts file]: test file does not include suite name, only tests
      • ✔️ [ts file]: test file test.describe.parallel mode should returns updated title.
    • 📎 [Playwright examples] lines processing
      • ✔️ [ts file]: the same import name as suite name
      • ✔️ [ts file]: test file without imports should update only suite & test name
      • ✔️ [js file]: the same require name as suite name
      • ✔️ [js file]: suite name as a new line
      • ✔️ test.skip() annotation inside a test is propersly processed
    • 📎 [Playwright examples] clean-ids for the --typescript mode
      • ✔️ can remove ids from the file with suite
      • ✔️ can remove ids if no suites in the file

📝 tests/updateIds_test.js

  • 📎 update ids
    • 📎 update-ids
      • ✔️ should update id by title
      • ✔️ should update id with tags by title
      • ✔️ updates ids from server
      • ✔️ ignore duplicates for ids from server
      • ✔️ should not update other strings in file
      • ✔️ allows multi-line titles
      • ✔️ respects string literals
      • ✔️ respects variables in string literals
      • ✔️ respects variables in string literals and JSON report mode
      • ✔️ respects variables in string literals in double param and JSON report mode
      • ✔️ works ok with empty files
      • ✔️ supports typescript
      • ✔️ supports typescript with types
      • ✔️ should not reformat the Array code with --typescript option
      • ✔️ should update nested scenarios
      • ✔️ should update ids based on filename for suites with included nested suites
    • 📎 clean-ids
      • ✔️ cleans up ids from strings
      • ✔️ cleans up ids from string literals
      • ✔️ unsafely cleans up ids from string literals
      • ✔️ can remove ids from typescript

📝 tests/utils_test.js

  • 📎 util functions
    • ✔️ #replaceAtPoint
    • 📎 #getAllSuiteTags
      • ✔️ should return empty array when no suites provided
      • ✔️ should return empty array when suites have no tags
      • ✔️ should collect tags from a single suite
      • ✔️ should collect tags from multiple suites
      • ✔️ should handle mixed suites with and without tags
      • ✔️ should not modify original suites array

@olexandr13 olexandr13 merged commit 3d80a30 into master Dec 17, 2025
1 check passed
@olexandr13 olexandr13 deleted the feature/playwright-describe-tags branch December 17, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants