Socket
Socket
Sign inDemoInstall

htest.dev

Package Overview
Dependencies
31
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    htest.dev

<header>


Version published
Weekly downloads
17
decreased by-80%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

hTest

Declarative, boilerplate-free unit testing, for everyone.

https://htest.dev

What the hTest? Do we really need another unit testing framework?

hTest is a unit testing framework that focuses on making unit testing as quick and painless as possible. Forget copy-pasting 10 lines of boilerplate to write a single test. TDD is hard enough as it stands — the more friction in writing tests, the fewer are written. hTest aims to eliminate all boilerplate, so you can focus on the tests themselves.

hTest can be used in one of two ways: HTML-first or JS-first:

  • In JS-first mode you write your tests in nested object literals, and you can run them either in Node or in the browser. Tests inherit values they don’t specify from their parents, so you never have to repeat yourself.
    • More suitable for pure JS code.
    • Compatible with CI and other automated test running processes.
    • Code must be compatible with Node to use the Node test runner.
  • In HTML-first mode you write your tests in HTML files and run them only in the browser.
    • More suitable for UI-heavy code.
    • Pass-criteria extends beyond value matching or error catching, and could even be things like what CSS selectors match or what the DOM looks like.
    • Reactive evaluation: if the HTML changes or the user interacts with the UI, relevant tests are re-evaluated.
    • Mock interactions like click or focus with HTML attributes.

You can even mix and match the two modes in the same testsuite! E.g. even a UI-heavy library has many JS-only functions that are better tested via JS-first tests.

It is still a work in progress (soft launched), but stable enough to be used in production. The main things that still need to be done before launch are:

  • Fix CLI output glitches and improve usability (ideal would be an interactive tree that starts off collapsed)
  • Improve documentation
  • Ensure we're not missing essential things (setup/teardown?)

Sample terminal output

hTest in the wild

JS-first testsuites

HTML-first testsuites

Testsuites
Single page tests

FAQs

Last updated on 14 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc