[Tests] Set up “mocks” directory, and updater script.

Jordan Harband 2016-04-19 22:49:49 -07:00
parent ac18d01854
commit 96afff7af2
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
5 changed files with 19 additions and 2 deletions

View File

@ -9,7 +9,7 @@ cleanup() {
. ../../../nvm.sh
# sample output at the time the test was written
TAB_PATH="$PWD/nodejs.org-dist-index.tab"
TAB_PATH="$PWD/mocks/nodejs.org-dist-index.tab"
nvm_download() {
cat "$TAB_PATH"
}

View File

@ -9,7 +9,7 @@ cleanup() {
. ../../../nvm.sh
# sample output at the time the test was written
TAB_PATH="$PWD/iojs.org-dist-index.tab"
TAB_PATH="$PWD/mocks/iojs.org-dist-index.tab"
nvm_download() {
cat "$TAB_PATH"
}

View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e
echo 'Updating test mocks...'
MOCKS_DIR="$PWD/test/fast/Unit tests/mocks"
echo "creating $MOCKS_DIR"
mkdir -p MOCKS_DIR
. "$NVM_DIR/nvm.sh"
nvm_download -L -s "$NVM_NODEJS_ORG_MIRROR/index.tab" -o - > "$MOCKS_DIR/nodejs.org-dist-index.tab"
nvm_download -L -s "$NVM_IOJS_ORG_MIRROR/index.tab" -o - > "$MOCKS_DIR/iojs.org-dist-index.tab"
echo "done! Don't forget to git commit them."