# Upstream runs its suite through pm-runtests, which needs @marijn/testtool --
# neither is packaged for Debian.  Smoke-test the built artifacts instead: both
# published entry points are loaded, and the bundled declarations are checked
# for the type imports they must re-export (those are only emitted when the
# linked modules are resolvable at build time).
test -f dist/index.js
test -f dist/index.cjs
test -f dist/index.d.ts
node -e 'require("./dist/index.cjs")'
node --input-type=module -e 'import("./dist/index.js")'
grep -Eq "from ['\"]prosemirror-model['\"]" dist/index.d.ts
grep -Eq "from ['\"]prosemirror-state['\"]" dist/index.d.ts
