This commit is contained in:
2025-09-28 18:09:07 +03:00
parent e7b0744ad8
commit 4d52cf09c5
2 changed files with 10 additions and 15 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ function greet(name) {
} }
module.export = greet; module.exports = greet;
if (require.main === module){ if (require.main === module){
console.log(greet("World")) console.log(greet("World"))
+9 -14
View File
@@ -1,19 +1,14 @@
#!/bin/bash #!/bin/bash
#src/test.sj # src/test.sh
EXPECTED=$"Hello, Test!"
OUTPUT=${node -e "console.log(require('./src/app'))('Test)"} EXPECTED="Hello, Test!"
OUTPUT=$(node -e "console.log(require('./src/app')('Test'))")
if [ "$OUTPUT" == $"$EXPECTED" ]; then
echo "Test passed!"
exit 0
if [ "$OUTPUT" == "$EXPECTED" ]; then
echo "Test passed!"
exit 0
else else
echo "Test failed! Expected '$EXPECTED' but got '$OUTPUT'"
echo "Test failed! Expected '$EXPECTED' but got '$OUTPUT'" exit 1
fi
exit 1
fi