Skip to content

Commit 2c43a24

Browse files
author
Mike Hays
committed
Use a heredoc in cd_into_package test helper
1 parent a820118 commit 2c43a24

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

test/test_helper.bash

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@ assert_success() {
4949

5050
# cd_into_package nodeVersion [extraArgs]
5151
cd_into_package() {
52-
local version="$1"
53-
local packageJson="{
54-
\"engines\": {
55-
\"node\": \"${version}\"
56-
}
57-
}"
5852
mkdir -p "$EXAMPLE_PACKAGE_DIR"
5953
cd "$EXAMPLE_PACKAGE_DIR" || return 1
60-
echo "$packageJson" > "$EXAMPLE_PACKAGE_DIR/package.json"
54+
local version="$1"
55+
cat << JSON > package.json
56+
{
57+
"engines": {
58+
"node": "$version"
59+
}
60+
}
61+
JSON
6162
}
6263

6364
cd_into_babel_env_package() {

0 commit comments

Comments
 (0)