From 42ea45a97f2e92cab7bdf40cabb3eae846a2a11c Mon Sep 17 00:00:00 2001 From: jahorton Date: Mon, 27 Apr 2020 13:21:03 +0700 Subject: [PATCH] fix(common/lmlayer): problem was with lm-layer npm run test --- common/predictive-text/package.json | 2 +- common/predictive-text/unit_tests/test.sh | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/common/predictive-text/package.json b/common/predictive-text/package.json index 0d3ca7bc70..1d2bcddee7 100644 --- a/common/predictive-text/package.json +++ b/common/predictive-text/package.json @@ -5,7 +5,7 @@ "main": "build/index.js", "scripts": { "karma": "karma", - "lerna": "cd ../ && npm run lerna --", + "lerna": "cd ../.. && npm run lerna --", "mocha": "mocha", "test": "bash ./unit_tests/test.sh", "tsc": "tsc" diff --git a/common/predictive-text/unit_tests/test.sh b/common/predictive-text/unit_tests/test.sh index 29b244938e..3351f131e3 100755 --- a/common/predictive-text/unit_tests/test.sh +++ b/common/predictive-text/unit_tests/test.sh @@ -1,10 +1,12 @@ #! /bin/bash # We should work within the script's directory, not the one we were called in. -cd $(dirname "$BASH_SOURCE") +THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" +. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE -# Include useful testing resource functions -. ../../../resources/shellHelperFunctions.sh +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" +SCRIPT_ROOT="$(dirname "$THIS_SCRIPT")" # A simple utility script to facilitate unit-testing for the LM Layer. # It's rigged to be callable by NPM to facilitate testing during development when in other folders. @@ -39,7 +41,7 @@ test-browsers ( ) { _FLAGS="$_FLAGS -CI -reporter teamcity" fi - in_browser/browser-test.sh $os_id $_FLAGS + $SCRIPT_ROOT/in_browser/browser-test.sh $os_id $_FLAGS } # Defaults