-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Major test infrastructure cleanup - API mock rewritten as koa middleware - Makefile rewritten - Updates travis runners - Resolves #191 Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
- Loading branch information
1 parent
3e152e8
commit 8e30fbb
Showing
136 changed files
with
14,085 additions
and
6,078 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,42 @@ | ||
BIN = node_modules/.bin | ||
DUO = $(BIN)/duo | ||
MINIFY = $(BIN)/uglifyjs | ||
WATCH = $(BIN)/wr | ||
DELEGATE = test test-browser test-sauce test-coverage | ||
T = $(BIN)/duo-test -m test/api.js -R spec -P 8378 | ||
|
||
BUILD = ./build | ||
WATCH_FILES = lib index.js component.json Makefile | ||
SRC = index.js $(shell find lib -type f -name '*.js') | ||
TESTS = $(wildcard test/*.test.js) | ||
|
||
build: node_modules | ||
@mkdir -p $(BUILD) | ||
@$(DUO) --quiet --stdout --global recurly index.js > $(BUILD)/recurly.js | ||
@$(MINIFY) $(BUILD)/recurly.js --output $(BUILD)/recurly.min.js | ||
test: test-phantomjs | ||
|
||
test-phantomjs: build/recurly.min.js build/test.js | ||
@$(T) phantomjs | ||
|
||
test-browser: build/recurly.min.js build/test.js | ||
@$(T) browser | ||
|
||
test-sauce: BROWSER ?= ie:9 | ||
test-sauce: build/recurly.min.js build/test.js | ||
@$(T) saucelabs -b $(BROWSER) | ||
|
||
build: build/recurly.min.js | ||
|
||
build/recurly.js: index.js $(SRC) node_modules component.json | ||
@mkdir -p $(@D) | ||
@$(DUO) --quiet --stdout --global recurly < $< > $@ | ||
|
||
build/recurly.min.js: build/recurly.js | ||
@$(BIN)/uglifyjs $< --output $@ | ||
|
||
build/test.js: TESTFILE = $(foreach test, $(TESTS), 'require("./$(test)");') | ||
build/test.js: $(TESTS) | ||
@echo $(TESTFILE) | $(DUO) --quiet --development --type js --stdout > $@ | ||
|
||
watch: node_modules | ||
@$(WATCH) make $(WATCH_FILES) | ||
@$(BIN)/wr $(MAKE) component.json $(SRC) | ||
|
||
node_modules: package.json | ||
@npm install --silent | ||
|
||
$(DELEGATE): build | ||
@cd test && make $@ | ||
|
||
clean: | ||
@rm -rf node_modules components/duo.json $(BUILD) | ||
@cd test && make $@ | ||
@rm -rf node_modules components/duo.json build | ||
|
||
.PHONY: clean build test test-browser test-sauce test-coverage | ||
.PHONY: test watch clean |
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,2 @@ | ||
components | ||
build |
Empty file.
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,11 @@ | ||
|
||
build: components index.js | ||
@component build --dev | ||
|
||
components: component.json | ||
@component install --dev | ||
|
||
clean: | ||
rm -rf build components | ||
|
||
.PHONY: clean |
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,12 @@ | ||
noop | ||
==== | ||
|
||
ever just want to do nothing? | ||
|
||
```js | ||
var noop = require('noop'); | ||
|
||
noop('into the void'); | ||
|
||
myProcessor(data, noop); | ||
``` |
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,14 @@ | ||
{ | ||
"name": "noop", | ||
"repo": "chrissrogers/noop", | ||
"description": "noop function", | ||
"version": "0.0.1", | ||
"keywords": [ | ||
"function" | ||
], | ||
"license": "MIT", | ||
"main": "index.js", | ||
"scripts": [ | ||
"index.js" | ||
] | ||
} |
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 @@ | ||
module.exports = function () {}; |
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,3 @@ | ||
build | ||
components | ||
node_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
0.5.0 / 2014-10-07 | ||
================== | ||
|
||
* index: Fix .throws() and .doesNotThrow() | ||
* add mocha diff | ||
|
||
0.4.0 / 2014-06-30 | ||
================== | ||
|
||
* fix default assertion messages | ||
* add testing server | ||
|
||
0.3.1 / 2014-06-03 | ||
================== | ||
|
||
* fix custom assertion messages being ignored | ||
|
||
0.3.0 / 2013-12-10 | ||
================== | ||
|
||
* add node assert methods | ||
|
||
0.2.0 / 2013-08-15 | ||
================== | ||
|
||
* update to work with latest component/stack. | ||
|
||
0.1.1 / 2012-10-09 | ||
================== | ||
|
||
* fix paren balancing with greedy capture | ||
|
||
0.1.0 / 2012-10-09 | ||
================== | ||
|
||
* add callsite support for auto-generated messages |
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,20 @@ | ||
|
||
build: components index.js | ||
@component build --dev | ||
|
||
components: component.json | ||
@component install --dev | ||
|
||
clean: | ||
@rm -fr build components | ||
|
||
node_modules: package.json | ||
@npm install | ||
|
||
server: node_modules build | ||
@node test/server.js | ||
|
||
test: build | ||
@open http://localhost:7575 | ||
|
||
.PHONY: clean server test |
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,25 @@ | ||
|
||
# assert | ||
|
||
C-style assertion lib. | ||
|
||
## Example | ||
|
||
With custom assertion message: | ||
|
||
```js | ||
var assert = require('assert'); | ||
assert(expr, 'oh no it broke'); | ||
``` | ||
|
||
Or auto-generated assertion message in | ||
browsers that support `Error.captureStackTrace()`: | ||
|
||
```js | ||
var assert = require('assert'); | ||
assert(user.name == 'Tobi'); | ||
``` | ||
|
||
## License | ||
|
||
MIT |
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,15 @@ | ||
{ | ||
"name": "assert", | ||
"repo": "component/assert", | ||
"description": "Assertion lib", | ||
"version": "0.5.0", | ||
"keywords": ["assert", "test"], | ||
"dependencies": { | ||
"component/stack": "*", | ||
"jkroso/equals": "*", | ||
"yields/fmt": "0.0.2" | ||
}, | ||
"scripts": [ | ||
"index.js" | ||
] | ||
} |
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,6 @@ | ||
<html> | ||
<body> | ||
<script src="build/build.js"></script> | ||
<script src="example.js"></script> | ||
</body> | ||
</html> |
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,13 @@ | ||
|
||
/** | ||
* Module dependencies. | ||
*/ | ||
|
||
var assert = require('assert'); | ||
|
||
function test() { | ||
var user = { name: 'Tobi' }; | ||
assert(user.name == 'tobi'); | ||
} | ||
|
||
test(); |
Oops, something went wrong.