Skip to content

Commit b08aa7a

Browse files
committed
test to ensure TLA is not in use in node
1 parent 005e560 commit b08aa7a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test/avoid-tla.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// This is so annoying.
2+
// even if you ship as ESM, node programs will try to require() it,
3+
// which breaks when TLA is in use. So, effectively, rather than just
4+
// not supporting top level await, node DOES support it, but in a way
5+
// that throws a hand grenade at unsuspecting downstream users.
6+
// Great.
7+
import t from 'tap'
8+
import { createRequire } from 'node:module'
9+
const require = createRequire(import.meta.url)
10+
t.doesNotThrow(() => require('../dist/esm/node/index.js'))

0 commit comments

Comments
 (0)