#mochajs — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #mochajs, aggregated by home.social.
-
Hi! A big #question for #webdev
// Context: a #Tauri application written in plain #JavaScript.
I used the #DOMParser to read an HTML file and display it as #Markdown.
For unit testing, I use #MochaJs, and I wanted to run the tests in the command line interface (CLI) with #nodejs.
However, Node.js does not have the DOMParser library. :/I then used jsdom to develop the function in a behaviour-driven development style, but this cannot be run in a browser.
I now realise that trying to test this functionality in this way is not a good idea.
What can I use instead? ??
You're welcome to #boost or ask for clarifications. :)
-
News about adopting posted in the #mochajs @opencollective: https://opencollective.com/mochajs/updates/adopting-collective-funds-guidelines-0-1
-
PR for adding it to #mochajs is here: https://github.com/mochajs/mocha/pull/5199
-
Published a first draft of Collective Funds Guidelines: https://github.com/collective-funds/guidelines
First user will be Mocha and its inspired by prior art of awesome fellow @openjsf projects @eslint and WebdriverIO 🙏
Thanks to (in no special order) @JoshuaKGoldberg, @mcollina, @west, @ulisesgascon, @uzlopak, @bcomnes for review, feedback and suggestions that helped shape this 🙏
-
Did my first #npmRelease of #MochaJS. Version 10.4.0 is now available, including some features and some fixes: https://github.com/mochajs/mocha/releases/tag/v10.4.0
Great collaboration with @JoshuaKGoldberg and @uzlopak as well as with the individual contributors.
Next up I hope to pick up the pace of my contributions on this project, but first I have some standard linting to enhance :BlobhajHeart:
-
#16: #mochajs - "A feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple."
-
@TheRealPomax I’m still a fan of #MochaJS with #Chai assertions. Jest requires to much to get it to work with modern #JavaScript development practices, it doesn’t even work well with #TypeScript and #ESModules.
-
I would appreciate any help on this: https://stackoverflow.com/questions/76782305/mochajs-test-keep-running-when-using-async-await
-
(if you don't call your API/DB sync way, #mochajs will not wait till the request is finished, meaning test results will not be stored.)
disclaimer: maybe it still works on different envs than darwin (macs) but not based on what I was reading... 🤷♂️ -
Now, why is there still a use case for needing sync code execution (instead of async)? Well, many reasons, like writing a custom #mochajs runner (@[email protected] uses mocha as well) where you need to send results to any database a the end of the test run - basic use case.