Skip to content

Commit

Permalink
Add post-publish-test.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
aminmarashi committed Sep 17, 2024
1 parent 31bedd4 commit 8799278
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions post-publish-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
npm link
mkdir test
pushd test
echo '{}' > package.json
npm install js-interpreter
cat > test.js <<EOF
const Interpreter = require('js-interpreter');
const initFunc = (interpreter, scope) => {
interpreter.setProperty(scope, 'console',
interpreter.nativeToPseudo({
log(...args) { console.log(...args); },
}));
};
(new Interpreter('console.log(\"Importing works!\")', initFunc)).run();
EOF
node test.js
echo "console.log('CLI works!');" | ./node_modules/.bin/js-interpreter
popd
rm -rf test

0 comments on commit 8799278

Please sign in to comment.