HackerTrans
TopNewTrendsCommentsPastAskShowJobs

izelnakri

no profile record

Submissions

QUnitX: Run the same test file in Node, Deno, and the browser. Zero dependencies

github.com
1 points·by izelnakri·4 tháng trước·1 comments

comments

izelnakri
·4 tháng trước·discuss


  I got tired of test frameworks that require config files, plugins, and 50MB of dependencies just to run assert.equal. So I built QUnitX.

  The pitch is simple: one test file, three runtimes, no changes.

  import { module, test } from 'qunitx';

  module('Math', () => {
    test('addition', (assert) => {
      assert.equal(2 + 2, 4);
    });
  });

  node --test math-test.js
  deno test math-test.js
  qunitx math-test.js  # browser, headless

  Why QUnit?

  I know the reaction: "QUnit? That jQuery thing from 2008?" — yes, exactly. That's the point. It's been solving real edge cases for 16 years that Jest/Vitest are still catching up to. assert.deepEqual correctly handles circular references, typed arrays, Maps, Sets, prototype chains. assert.step / assert.verifySteps catches missing async callbacks that other frameworks silently swallow. assert.expect(n) fails if the wrong number of assertions ran — invaluable when async code paths are involved.

  What QUnitX actually does:

  - Wraps Node's built-in node:test runner with the QUnit lifecycle (no Jest, no Vitest, nothing extra)
  - Wraps Deno's native BDD runner the same way
  - Browser path is a thin re-export of QUnit itself — full browser UI with filterable, shareable test URLs

  TypeScript works out of the box (node --import=tsx/esm --test). Coverage via npx c8. Watch mode via --watch. Zero runtime dependencies.

  The browser demo is what I'm most proud of — the QUnit UI lets you filter to any test and share the URL, so your colleague sees the exact same filtered view. We've been using this in production for years and it never gets old.
Repo: https://github.com/izelnakri/qunitx
izelnakri
·5 năm trước·discuss
He could have protected himself by making his shares the same voting rights as common class and not selling them, signalling his loyalty to shareholders. It should be illegal to issue shares to public with lower voting rights in my view. Our world would be a different place if google/facebook had only one type of voting class and I dont think what I view is strictly political.