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

Logging for the default assert library #217

Open
wants to merge 37 commits into
base: next
Choose a base branch
from

Conversation

dev-ardi
Copy link

⚠️ This is a draft, don't merge me ⚠️

This adds toggleable logging for the default library.

  • Activate/deactivate with LOG_ASSERTS
  • This should be toggled on/off in a config object, per suite/test?

TODO

  • This uses console.log without any formatting. Personally I'd store the messages and format them once the test has finished. I don't know if this can be easily done without coupling uvu to the assert library, I haven't checked the code.
  • Pass on the toggle option
  • Maybe choose another log message

lukeed and others added 30 commits February 1, 2021 16:09
Replaces `arr.map()` with a for-loop to avoid a "Max call stack size exceeded" error for fixtures with *many* lines to dedent.

Closes lukeed#115
* docs: added information for assert.match

* docs: added information for assert.not.match

* docs: added more information per requested change
* chore: add esbuild example

* chore: remove `.gitignore` file

Co-authored-by: Luke Edwards <[email protected]>
- Similar to "typescript" example, but uses `"type": "module"` and source files only include ".js" files with ESM syntax. This matches the scenario(s) presented in lukeed#123

Also includes two approaches for solving this problem; see npm "scripts" section.

Closes lukeed#123
* chore: add "solidjs" example

* chore: lock devdependency versions

Co-authored-by: Luke Edwards <[email protected]>
- drops / inlines totalist dependency
- Closes lukeed#111
* Update api.assert.md

Adding a reference on the idiom of how to assert an async function throws an error: 
lukeed#35 (comment)

* Apply suggestions from code review

* Update docs/api.assert.md

Co-authored-by: Luke Edwards <[email protected]>
* Fix missing assertion error on array type mismatch

* chore: add mirror test

* nit: code style

Co-authored-by: Luke Edwards <[email protected]>
- do not build `uvu/parse` from source since it needs different contents, like uvu/run
- rely on `require` directly for loading file paths (revert 4cedf40)
lukeed and others added 7 commits July 3, 2022 11:18
- ensures `uvu` initializes with shared ENV/global context
* Detect BigInt within circular() and properly convert them within stringify

* narrower bigint check

* update test expectants

* fix: avoid bigint syntax errors in Node8

Co-authored-by: Luke Edwards <[email protected]>
…ises (lukeed#207)

* A test that exits early should fail

Fixes lukeed#206

Also fixes the case where a test calls process.exit(0) itself, as that's essentially the same thing.

* Apply suggestions from code review

* wrap exit listener; merge test files

Co-authored-by: Luke Edwards <[email protected]>
You can choose what to do with it later too.
@dev-ardi
Copy link
Author

dev-ardi commented Aug 24, 2022

Last commit I ran prettier with the .editorconfig settings, because I was copy pasting stuff fast, that's where some of the changes come from.

@dev-ardi dev-ardi mentioned this pull request Aug 25, 2022
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.