Skip to content

Commit

Permalink
test all command #12
Browse files Browse the repository at this point in the history
  • Loading branch information
hh committed Mar 4, 2023
1 parent 0f68af4 commit c9c872d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ coverage


templates/dapp/
templates/hello-world/
templates/hello-world/
templates/stateful-counter/
templates/my-lib/
51 changes: 45 additions & 6 deletions test-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,60 @@ rm -rf hello-world
npx scrypt-cli project hello-world
cd hello-world

if tree . | grep -q 'helloWorld.ts'; then
echo "find helloWorld.ts"
else
if ! tree . | grep -q 'helloWorld.ts'; then
echo "cannot find helloWorld.ts"
exit -1
fi

if tree . | grep -q 'helloWorld.test.ts'; then
echo "find helloWorld.test.ts"
else
if ! tree . | grep -q 'helloWorld.test.ts'; then
echo "cannot find helloWorld.test.ts"
exit -1
fi

npm i
npm t
npm run genprivkey
cd ..


echo "testing npx scrypt-cli project --state stateful-counter"
rm -rf stateful-counter
npx scrypt-cli project --state stateful-counter
cd stateful-counter

if ! tree . | grep -q 'statefulCounter.ts'; then
echo "cannot find statefulCounter.ts"
exit -1
fi

if ! tree . | grep -q 'statefulCounter.test.ts'; then
echo "cannot find statefulCounter.test.ts"
exit -1
fi
npm i
npm t
npm run genprivkey
cd ..


echo "testing npx scrypt-cli project --lib my-lib"
rm -rf my-lib
npx scrypt-cli project --lib my-lib
cd my-lib

if ! tree . | grep -q 'myLib.ts'; then
echo "cannot find myLib.ts"
exit -1
fi

if ! tree . | grep -q 'myLib.test.ts'; then
echo "cannot find myLib.test.ts"
exit -1
fi
npm i
npm t
npm run genprivkey
cd ..

echo "testing npx scrypt-cli system"
npx scrypt-cli system

0 comments on commit c9c872d

Please sign in to comment.