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){
console.log(greet("World"))
+9 -14
View File
@@ -1,19 +1,14 @@
#!/bin/bash
#src/test.sj
EXPECTED=$"Hello, Test!"
# src/test.sh
OUTPUT=${node -e "console.log(require('./src/app'))('Test)"}
if [ "$OUTPUT" == $"$EXPECTED" ]; then
echo "Test passed!"
exit 0
EXPECTED="Hello, Test!"
OUTPUT=$(node -e "console.log(require('./src/app')('Test'))")
if [ "$OUTPUT" == "$EXPECTED" ]; then
echo "Test passed!"
exit 0
else
echo "Test failed! Expected '$EXPECTED' but got '$OUTPUT'"
exit 1
fi
echo "Test failed! Expected '$EXPECTED' but got '$OUTPUT'"
exit 1
fi