Skip to content

Commit

Permalink
Remove indentations
Browse files Browse the repository at this point in the history
  • Loading branch information
oskogstad committed Jan 14, 2025
1 parent 7b8dac9 commit 799d0cf
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions tests/k6/scripts/generate_all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@ fi
IMPORT_STATEMENTS=""
FUNCTION_BODY=""

# Get all *.js files in the directory except for "all-tests.js"
for JS_FILE in "$DIRECTORY_PATH"/*.js; do
if [[ $DIRECTORY_PATH != *"/performance/"* ]]; then
BASE_NAME=$(basename "$JS_FILE" .js)
# Skip files in the "performance" directory or the "all-tests.js" file
if [[ $DIRECTORY_PATH == *"/performance/"* ]] ||
[[ $(basename "$JS_FILE" .js) == "all-tests" ]]; then
continue
fi

if [[ "$BASE_NAME" != "all-tests" ]]; then
# Append to import strings
IMPORT_STATEMENTS="${IMPORT_STATEMENTS}import { default as ${BASE_NAME} } from './${BASE_NAME}.js';"$'\n'
BASE_NAME=$(basename "$JS_FILE" .js)

# Append to function body
FUNCTION_BODY="${FUNCTION_BODY} ${BASE_NAME}();"$'\n'
fi
fi
# Append to import strings
IMPORT_STATEMENTS="${IMPORT_STATEMENTS}import { default as ${BASE_NAME} } from './${BASE_NAME}.js';"$'\n'

# Append to function body
FUNCTION_BODY="${FUNCTION_BODY} ${BASE_NAME}();"$'\n'
done

# Combine all the content
Expand Down

0 comments on commit 799d0cf

Please sign in to comment.