5 readonly TEST_FILES
='test/input/js';
11 for file in "$TEST_FILES"/*; do
13 echo "[~] validate ${file}";
15 local expectedFile
="$(sed 's/\.js$//; s/input/output/' <<< "$file")";
16 local output
="$(FORCE_COLOR=0 node scripts/linter.mjs "$file")";
17 local expectedOutput
="$(cat "$expectedFile")";
19 if [ "$expectedOutput" != "$output" ]; then
21 echo -e " 💥 \e[1m\e[31mError\e[39m\e[0m wrong output for ${file}"
22 echo -e "\e[4m🤖 Output\e[0m:"
23 echo "$(echo "$output")";
25 echo -e "\e[4m🤖 Expected\e[0m:"
26 echo "$expectedOutput";
29 echo '-----------------[DIFF]-----------------------'
31 diff -rupP <(echo "$output") <(echo "$expectedOutput")
33 echo '-----------------[/DIFF]-----------------------'
36 echo -e "\e[32m ✔ lint translations for ${file}\e[0m";