Skip to content

Commit 00a0ca7

Browse files
committed
Add task to test npm install
1 parent 1ae3c34 commit 00a0ca7

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

tools/ci/circle/script

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,20 @@ lint() {
330330
return 0
331331
}
332332

333+
# Tests the ability to install the project via npm.
334+
#
335+
# $1 - log file
336+
test_npm_install() {
337+
echo 'Testing npm install...' >&2
338+
npm install @stdlib/stdlib >> "$1" 2>&1
339+
if [[ "$?" -ne 0 ]]; then
340+
echo 'npm install failed.' >&2
341+
return 1
342+
fi
343+
echo 'Successfully performed npm install.' >&2
344+
return 0
345+
}
346+
333347
# Finds test files.
334348
find_tests() {
335349
local kernel
@@ -404,7 +418,7 @@ main() {
404418
local len
405419
local i
406420

407-
TASKS=(check_deps check_licenses lint)
421+
TASKS=(check_deps check_licenses lint test_npm_install)
408422
len="${#TASKS[@]}"
409423

410424
create_log_file "${log_file}"
@@ -445,6 +459,11 @@ main() {
445459
if [[ "$?" -ne 0 ]]; then
446460
on_error 1
447461
fi
462+
elif [[ "${task}" = "test_npm_install" ]]; then
463+
test_npm_install "${log_file}"
464+
if [[ "$?" -ne 0 ]]; then
465+
on_error 1
466+
fi
448467
fi
449468
i=$(expr "${i}" + "${len}")
450469
done

0 commit comments

Comments
 (0)