forked from kaitai-io/kaitai_struct_tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci-javascript
executable file
·23 lines (19 loc) · 970 Bytes
/
ci-javascript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
. ./config
# Symlinks fresh KS JavaScript runtime into node_modules dir
mkdir -p "$JAVASCRIPT_MODULES_DIR"
if [ ! -e "$JAVASCRIPT_MODULES_DIR/kaitai-struct" ]; then
ABS_JS_RUNTIME=$(pwd)/$JAVASCRIPT_RUNTIME_DIR
ln -s "$ABS_JS_RUNTIME" "$JAVASCRIPT_MODULES_DIR/kaitai-struct"
fi
# The `iconv-lite` package is assumed to be installed globally in the Docker
# image, but in Node.js 10 and older, you can only `require()` local packages,
# not global packages. `npm link` creates a symbolic link in the local
# `node_modules/` directory pointing to the globally installed package.
npm link iconv-lite
mkdir -p "$TEST_OUT_DIR/javascript"
NODE_PATH=compiled/javascript:helpers/javascript:$JAVASCRIPT_MODULES_DIR:$JAVASCRIPT_RUNTIME_DIR \
mocha \
-R xunit spec/javascript >"$TEST_OUT_DIR/javascript/test-output-javascript.xml"
./kst-adoption-report javascript
aggregate/convert_to_json javascript "$TEST_OUT_DIR/javascript" "$TEST_OUT_DIR/javascript/ci.json"