Skip to content

Add expects: fail and ok#10

Merged
kobenguyent merged 5 commits intocodeceptjs:mainfrom
Kudisoldier:add_expects
Apr 30, 2026
Merged

Add expects: fail and ok#10
kobenguyent merged 5 commits intocodeceptjs:mainfrom
Kudisoldier:add_expects

Conversation

@Kudisoldier
Copy link
Copy Markdown
Contributor

Summary

Adds two new assertion wrappers to ExpectHelper:

  • I.expectFail() to explicitly fail a test with an optional custom message
  • I.expectOk() to assert that a value is truthy

Changes

  • Implemented expectFail(customErrorMsg = 'expect fail')

  • Implemented expectOk(actualValue, customErrorMsg = '')

  • Added TypeScript definitions for both methods

  • Added README documentation with examples

  • Added unit tests covering:

    • custom failure message
    • default failure message
    • truthy values passing
    • falsy values failing with custom/default Chai messages

Testing

Added tests in index_test.js for both new wrappers.

@Kudisoldier
Copy link
Copy Markdown
Contributor Author

@thomashohn could you run a workflow and make an review, please?

@Kudisoldier
Copy link
Copy Markdown
Contributor Author

Kudisoldier commented Apr 29, 2026

@thomashohn Can you also merge this PR, please? cuz i don't have an active merge button in UI

@thomashohn thomashohn requested a review from kobenguyent April 29, 2026 15:51
@thomashohn
Copy link
Copy Markdown
Contributor

thomashohn commented Apr 29, 2026

@kobenguyent - can you review this one - I can merge it at create an release if it's ok

@kobenguyent kobenguyent merged commit 9eaac47 into codeceptjs:main Apr 30, 2026
2 checks passed
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