Skip to content

Commit

Permalink
test: add explanation comment
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed Jun 11, 2024
1 parent 78beef5 commit 069cef8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/testExports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ npm init -y || exit $?

rm -f index.mjs
touch index.mjs
# We test that all JS files we publish are importable without an extension
tar -t -f ./supertokens-node* | grep \\.js$ | sed 's/^package\/\(.*\)\.js$/import \"supertokens-node\/\1\";/' >> index.mjs
# We test that all JS files we publish are importable with the JS extension
tar -t -f ./supertokens-node* | grep \\.js$ | sed 's/^package\/\(.*\)\.js$/import \"supertokens-node\/\1\.js";/' >> index.mjs
# We test that all folders that have an index.js (outside of /lib/build) are importable as folders.
tar -t -f --exclude package/lib/build ./supertokens-node* | grep package/.*/index\\.js$ | sed 's/^package\/\(.*\)\/index\.js$/import \"supertokens-node\/\1\";/' >> index.mjs
# We also test that the sdk itself is importable
echo 'import "supertokens-node";' >> index.mjs

mkdir -p node_modules/supertokens-node
Expand Down

0 comments on commit 069cef8

Please sign in to comment.