Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
language: node_js
script: 'if [ -n "$ARTIFACT" ]; then make test; else make test-sauce; fi'
node_js:
- '0.12'
install:
- mkdir travis-phantomjs
- 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
- tar -xvf $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -C $PWD/travis-phantomjs
- export PATH=$PWD/travis-phantomjs:$PATH

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loads phantomjs 2.0 in travis. This is important because phantomjs < 2.0 does not support Function.prototype.bind. Our test suite previously provided a shim -- but I like this solution better. Travis should update to support phantomjs 2.0 soon.

script:
- 'if [ -n "$ARTIFACT" ]; then make test; else make test-sauce; fi'
before_script:
- 'if [ -n "$ARTIFACT" ]; then gem install travis-artifacts; fi'
after_success:
Expand All @@ -19,7 +25,10 @@ env:
- BROWSER: chrome
- BROWSER: firefox
- BROWSER: safari
- BROWSER: ie9..11
- BROWSER: ipad6..8
- BROWSER: iphone6..8
- BROWSER: ie:11
- BROWSER: ie:10
- BROWSER: ie:9
- BROWSER: iphone:8
- BROWSER: iphone:7
- BROWSER: iphone:6

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dropped ipad 6-8 as iphone should cover our testing needs. Open to hearing arguments against.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine nowadays - I wouldn’t stress it.

- ARTIFACT: 1
46 changes: 30 additions & 16 deletions Makefile
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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-phantomjs is the new default target. It depends on a full build. Good to encourage spec runs.


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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default sauce test browser is ie9. It is typically the most problematic; thus, running make test-sauce will let you run the suite on ie9 and interact with the browser remotely during the suite run.

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 < $< > $@

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@D is the directory of the target: build
$< is the first dependency
$@ is the target


build/recurly.min.js: build/recurly.js
@$(BIN)/uglifyjs $< --output $@

build/test.js: TESTFILE = $(foreach test, $(TESTS), 'require("./$(test)");')

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generates a series of requires from the list of test files to act as the main for the test suite.

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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ implementations.

## Build
```bash
$ make
$ make build
```

If you are having issues with the build, try `make clean`

## Test
```bash
$ make test
$ make
```

## Beta Features
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"webmodules/jsonp": "0.0.4",
"yields/cors-xhr": "1.0.1",
"yields/merge": "1.0.0",
"visionmedia/debug": "2.1.3",
"visionmedia/debug": "2.2.0",
"then/promise": "6.0.0",
"kewah/mixin": "0.1.0",
"pluma/par": "0.3.0",
Expand Down
2 changes: 2 additions & 0 deletions components/chrissrogers-noop@master/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
components
build

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the component commits from here on down are due to the test suite dependencies being loaded in the repo root, which is committed. As a bonus, the specs will now run faster since it will not be necessary to download any dependencies during spec runs.

Empty file.
11 changes: 11 additions & 0 deletions components/chrissrogers-noop@master/Makefile
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
12 changes: 12 additions & 0 deletions components/chrissrogers-noop@master/README.md
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);
```
14 changes: 14 additions & 0 deletions components/chrissrogers-noop@master/component.json
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"
]
}
1 change: 1 addition & 0 deletions components/chrissrogers-noop@master/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = function () {};
3 changes: 3 additions & 0 deletions components/component-assert@0.5.0/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
components
node_modules
37 changes: 37 additions & 0 deletions components/component-assert@0.5.0/History.md
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
20 changes: 20 additions & 0 deletions components/component-assert@0.5.0/Makefile
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
25 changes: 25 additions & 0 deletions components/component-assert@0.5.0/Readme.md
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
15 changes: 15 additions & 0 deletions components/component-assert@0.5.0/component.json
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"
]
}
6 changes: 6 additions & 0 deletions components/component-assert@0.5.0/example.html
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>
13 changes: 13 additions & 0 deletions components/component-assert@0.5.0/example.js
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();
Loading