Skip to content

Commit 5034967

Browse files
committed
Adjusted logging
1 parent c0d10d0 commit 5034967

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"jsdom": "^16.3.0"
1616
},
1717
"scripts": {
18-
"call-jest": "jest --testRegex .*/utils/js/.* --verbose=true",
1918
"build:runtime_tests": "./utils/runtime_tests_build.sh",
19+
"run:jest": "jest --testRegex .*/utils/js/.* --verbose=true",
2020
"run:runtime_tests": "./utils/runtime_tests_run.sh",
21-
"runtime_tests": "npm run build:runtime_tests && npm run run:runtime_tests"
21+
"runtime_tests": "npm run --silent build:runtime_tests && npm run --silent run:runtime_tests"
2222
}
2323
}

utils/js/runtimeTests.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ describe('Runtime tests', () => {
2525
const virtualConsole = new VirtualConsole()
2626
.on('log', (msg) => {
2727
logs.push(msg);
28-
if (/Tests complete/i.test(msg)) TestIsFinished.ready();
29-
else if (/Tests failed/i.test(msg)) TestIsFinished.cancel();
28+
if (/Tests complete/i.test(msg)) TestIsFinished.ready(logs.join('\n'));
29+
else if (/Tests failed/i.test(msg)) TestIsFinished.cancel(logs.join('\n'));
3030
});
3131

3232
const TEST_DOC = fs.readFileSync(
@@ -46,13 +46,12 @@ describe('Runtime tests', () => {
4646
});
4747

4848
try {
49-
console.log(`Executing tests in suite ${TEST_NAME}`);
5049
await TestIsFinished;
5150
} catch(e) {
52-
logAll();
51+
// logAll();
5352
fail(`Failed test in suite ${TEST_NAME}: \n\n${e}`);
5453
}
55-
54+
console.log(`Passed all tests in suite ${TEST_NAME}`);
5655
});
5756
}
5857
});

utils/runtime_tests_build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#!/bin/bash
1717

18+
echo -e "\nBuilding runtime tests..."
19+
1820
# to translate from relative dir
1921
abs_dirname() {
2022
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
@@ -31,7 +33,7 @@ fi
3133
i=0
3234
compileRuntimeTests(){
3335
for FILE in $@; do
34-
36+
3537
FILE_BASE=$(echo $FILE | rev | cut -f 2- -d '.' | rev)
3638
TEST_NAME=$(basename $FILE_BASE)
3739
TEST_LOC=$(dirname $FILE)

utils/runtime_tests_run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
echo "Executing runtime tests..."
17-
npm run --silent call-jest
16+
echo -e "\nExecuting runtime tests..."
17+
npm run --silent run:jest

0 commit comments

Comments
 (0)