Skip to content

Commit d2d14ed

Browse files
committed
Uses duo-test
- Major test infrastructure cleanup - API mock rewritten as koa middleware - Makefile rewritten - Updates travis runners - Resolves #191 Signed-off-by: Christopher Rogers <[email protected]>
1 parent 100eff4 commit d2d14ed

File tree

132 files changed

+15723
-5996
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+15723
-5996
lines changed

.travis.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
language: node_js
2-
script: 'if [ -n "$ARTIFACT" ]; then make test; else make test-sauce; fi'
32
node_js:
43
- '0.12'
4+
install:
5+
- mkdir travis-phantomjs
6+
- wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2
7+
- tar -xvf $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -C $PWD/travis-phantomjs
8+
- export PATH=$PWD/travis-phantomjs:$PATH
9+
script:
10+
- 'if [ -n "$ARTIFACT" ]; then make test; else make test-sauce; fi'
511
before_script:
612
- 'if [ -n "$ARTIFACT" ]; then gem install travis-artifacts; fi'
713
after_success:
@@ -19,7 +25,10 @@ env:
1925
- BROWSER: chrome
2026
- BROWSER: firefox
2127
- BROWSER: safari
22-
- BROWSER: ie9..11
23-
- BROWSER: ipad6..8
24-
- BROWSER: iphone6..8
28+
- BROWSER: ie:11
29+
- BROWSER: ie:10
30+
- BROWSER: ie:9
31+
- BROWSER: iphone:8
32+
- BROWSER: iphone:7
33+
- BROWSER: iphone:6
2534
- ARTIFACT: 1

Makefile

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,42 @@
11
BIN = node_modules/.bin
22
DUO = $(BIN)/duo
3-
MINIFY = $(BIN)/uglifyjs
4-
WATCH = $(BIN)/wr
5-
DELEGATE = test test-browser test-sauce test-coverage
3+
T = $(BIN)/duo-test -m test/api.js -R spec -P 8378
64

7-
BUILD = ./build
8-
WATCH_FILES = lib index.js component.json Makefile
5+
SRC = index.js $(shell find lib -type f -name '*.js')
6+
TESTS = $(wildcard test/*.test.js)
97

10-
build: node_modules
11-
@mkdir -p $(BUILD)
12-
@$(DUO) --quiet --stdout --global recurly index.js > $(BUILD)/recurly.js
13-
@$(MINIFY) $(BUILD)/recurly.js --output $(BUILD)/recurly.min.js
8+
test: test-phantomjs
9+
10+
test-phantomjs: build/recurly.min.js build/test.js
11+
@$(T) phantomjs
12+
13+
test-browser: build/recurly.min.js build/test.js
14+
@$(T) browser
15+
16+
test-sauce: BROWSER ?= ie:9
17+
test-sauce: build/recurly.min.js build/test.js
18+
@$(T) saucelabs -b $(BROWSER)
19+
20+
build: build/recurly.min.js
21+
22+
build/recurly.js: index.js $(SRC) node_modules component.json
23+
@mkdir -p $(@D)
24+
@$(DUO) --quiet --stdout --global recurly < $< > $@
25+
26+
build/recurly.min.js: build/recurly.js
27+
@$(BIN)/uglifyjs $< --output $@
28+
29+
build/test.js: TESTFILE = $(foreach test, $(TESTS), 'require("./$(test)");')
30+
build/test.js: $(TESTS)
31+
@echo $(TESTFILE) | $(DUO) --quiet --development --type js --stdout > $@
1432

1533
watch: node_modules
16-
@$(WATCH) make $(WATCH_FILES)
34+
@$(BIN)/wr $(MAKE) component.json $(SRC)
1735

1836
node_modules: package.json
1937
@npm install --silent
2038

21-
$(DELEGATE): build
22-
@cd test && make $@
23-
2439
clean:
25-
@rm -rf node_modules components/duo.json $(BUILD)
26-
@cd test && make $@
40+
@rm -rf node_modules components/duo.json build
2741

28-
.PHONY: clean build test test-browser test-sauce test-coverage
42+
.PHONY: test watch clean
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
components
2+
build

components/chrissrogers-noop@master/History.md

Whitespace-only changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
build: components index.js
3+
@component build --dev
4+
5+
components: component.json
6+
@component install --dev
7+
8+
clean:
9+
rm -rf build components
10+
11+
.PHONY: clean
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
noop
2+
====
3+
4+
ever just want to do nothing?
5+
6+
```js
7+
var noop = require('noop');
8+
9+
noop('into the void');
10+
11+
myProcessor(data, noop);
12+
```
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "noop",
3+
"repo": "chrissrogers/noop",
4+
"description": "noop function",
5+
"version": "0.0.1",
6+
"keywords": [
7+
"function"
8+
],
9+
"license": "MIT",
10+
"main": "index.js",
11+
"scripts": [
12+
"index.js"
13+
]
14+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = function () {};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build
2+
components
3+
node_modules
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
0.5.0 / 2014-10-07
3+
==================
4+
5+
* index: Fix .throws() and .doesNotThrow()
6+
* add mocha diff
7+
8+
0.4.0 / 2014-06-30
9+
==================
10+
11+
* fix default assertion messages
12+
* add testing server
13+
14+
0.3.1 / 2014-06-03
15+
==================
16+
17+
* fix custom assertion messages being ignored
18+
19+
0.3.0 / 2013-12-10
20+
==================
21+
22+
* add node assert methods
23+
24+
0.2.0 / 2013-08-15
25+
==================
26+
27+
* update to work with latest component/stack.
28+
29+
0.1.1 / 2012-10-09
30+
==================
31+
32+
* fix paren balancing with greedy capture
33+
34+
0.1.0 / 2012-10-09
35+
==================
36+
37+
* add callsite support for auto-generated messages

0 commit comments

Comments
 (0)