![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
t.todo
, t.fixme
for broken / unfinished testst.node
, t.browser
, t.require
, t.import
- environment conditional testst.demo
- demo-run (can fail)t.is
- assert with t.equal
for primitives and t.deepEqual
for othert.oneOf(item, list, msg)
- assert optional resultst.almost(a, b, eps, msg)
- assert approx value/arrayt.same(listA, listB, msg)
- assert same membersconsole.group
in browseronly
testsidle
or
import t from 'https://unpkg.com/tst?module'
t('these tests will all pass', t => {
t.ok(true);
t.ok(true, 'this time with an optional message');
t.ok('not true, but truthy enough');
t.is(1 + 1, 2);
t.is(Math.max(1, 2, 3), 3);
t.is({}, {})
t.throws(() => {
throw new Error('oh no!');
}, /oh no!/);
t.pass('ok')
})
t('these tests will not pass', t => {
t.is(42, '42');
t.is({}, {x:1});
t.fail('nok')
})
t.skip('this test will not run', t => {
t.pass('ok')
})
HK
FAQs
Tests without efforts
The npm package tst receives a total of 183 weekly downloads. As such, tst popularity was classified as not popular.
We found that tst demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.