This repository has been archived by the owner on Mar 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
316 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Versions | ||
environment: | ||
matrix: | ||
- nodejs_version: 0.10 | ||
- nodejs_version: 0.12 | ||
- nodejs_version: 4 | ||
- nodejs_version: 5 | ||
|
||
# Install scripts. (runs after repo cloning) | ||
install: | ||
# Get the latest stable version of Node.js or io.js | ||
- ps: Install-Product node $env:nodejs_version | ||
# Install and use local, modern NPM | ||
- npm install npm@next | ||
# install modules | ||
- node_modules\.bin\npm install | ||
|
||
# Post-install test scripts. | ||
test_script: | ||
# Output useful info for debugging. | ||
- node --version | ||
- node_modules\.bin\npm --version | ||
# run tests | ||
- node_modules\.bin\npm run builder:check | ||
|
||
# Don't actually build. | ||
build: off | ||
|
||
matrix: | ||
fast_finish: true | ||
|
||
cache: | ||
- node_modules -> package.json # local npm modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"use strict"; | ||
|
||
/** | ||
* A super-simple clone. | ||
* | ||
* Rationale: Lodash's `_.clone(|Deep)` has problems with empty strings | ||
* on certain Node versions with the ever terrifying `process.env` pseudo- | ||
* object. | ||
* | ||
* Limitations: No functions, no circular references, etc. | ||
* | ||
* @param {Object} obj Object to clone | ||
* @returns {Object} Cloned object | ||
*/ | ||
module.exports = function (obj) { | ||
return JSON.parse(JSON.stringify(obj)); // Such hackery... | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "builder", | ||
"version": "0.0.1", | ||
"config": { | ||
"msg": "hi" | ||
}, | ||
"scripts": { | ||
"echo": "echo ECHO MSG: ${npm_package_config_msg}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
# Change to test directory. | ||
cd "${0%/*}" | ||
|
||
# Variables | ||
BUILDER="${PWD}/../../bin/builder.js" | ||
|
||
echo -e "\nTEST: Basic config overrides" | ||
OUT=$(node ${BUILDER} run echo); | ||
if [[ $OUT != *"ECHO MSG: hi"* ]]; then echo -e "\n\n=== FAILED OUTPUT ===\n${OUT}\n\n"; exit 1; fi | ||
|
||
echo -e "\nTEST: Silence log" | ||
OUT=$(node ${BUILDER} run echo --log-level=none) | ||
if [[ $OUT == *"builder-core:start"* ]]; then echo -e "\n\n=== FAILED OUTPUT ===\n${OUT}\n\n"; exit 1; fi | ||
|
||
echo -e "\nTEST: Env overrides config" | ||
OUT=$(npm_package_config_msg="over" node ${BUILDER} run echo) | ||
if [[ $OUT != *"ECHO MSG: over"* ]]; then echo -e "\n\n=== FAILED OUTPUT ===\n${OUT}\n\n"; exit 1; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.