Skip to content

Commit

Permalink
feat: initial structure
Browse files Browse the repository at this point in the history
setup tests script and hello
  • Loading branch information
c0utin committed Sep 27, 2024
1 parent 004e402 commit 6e86224
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
},
"output_env_file": ".env",
"version": 1
}
}
19 changes: 19 additions & 0 deletions src/parsekoto_backend/tests/hello_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# ANSI color codes for green and red
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color

# Test the greet function
RESPONSE=$(dfx canister call parsekoto_backend greet '("ICP")')

# Verify the result
EXPECTED='"Hello, ICP!"'
if [[ "$RESPONSE" == *"$EXPECTED"* ]]; then
echo -e "${GREEN}Test passed: $RESPONSE${NC}"
else
echo -e "${RED}Test failed: Expected $EXPECTED but got $RESPONSE${NC}"
exit 1
fi

0 comments on commit 6e86224

Please sign in to comment.