Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix unit tests: remove mock-fs lib #179

Merged
merged 4 commits into from
Sep 19, 2024
Merged

fix unit tests: remove mock-fs lib #179

merged 4 commits into from
Sep 19, 2024

Conversation

olexandr13
Copy link
Contributor

@olexandr13 olexandr13 commented Sep 19, 2024

rm mock-fs
use fs instead

fix unit tests

upd node from 18 to 20 for actions

Copy link

🌀 Tests overview by Testomatio

Found 126 mocha tests in 16 files
No new tests added or removed

📑 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
    • 📎 env variable params
      • ✔️ should prepend a dir from env variable

📝 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/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

📝 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/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
      • ✔️ 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-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

📝 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_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
    • 📎 [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
    • 📎 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

@DavertMik DavertMik merged commit 226d7cf into master Sep 19, 2024
1 check passed
@DavertMik DavertMik deleted the fix-mock-fs branch September 19, 2024 18:15
@@ -14,7 +14,7 @@ jobs:
- name: Setup Node.js for use with actions
uses: actions/setup-node@v2
with:
node-version: '18'
node-version: '20'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olexandr13 ,

Is there any particular reason not to update node version in the action.yml. Just an omission I guess ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants