Permalink
Browse files

fixed test causes

  • Loading branch information...
1 parent 02d3f48 commit 4ca227cce742b6e9a9e96c8799fef601b91d0504 @fengmk2 fengmk2 committed Jun 24, 2013
Showing with 40 additions and 30 deletions.
  1. +3 −2 .travis.yml
  2. +1 −1 LICENSE.txt
  3. +19 −9 Makefile
  4. +3 −5 README.md
  5. +1 −1 index.js
  6. +8 −7 package.json
  7. +4 −4 test/fixtures/server.js
  8. +1 −1 test/formstream.test.js
View
@@ -1,5 +1,6 @@
language: node_js
node_js:
- - 0.9
- 0.8
- - 0.6
+ - '0.10'
+ - '0.11'
+script: make test-coveralls
View
@@ -1,6 +1,6 @@
This software is licensed under the MIT License.
-Copyright (C) 2012 by fengmk2 <fengmk2@gmail.com>
+Copyright (C) 2012 - 2013 by fengmk2 <fengmk2@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
@@ -1,20 +1,30 @@
TESTS = test/*.test.js
REPORTER = spec
TIMEOUT = 10000
-JSCOVERAGE = ./node_modules/jscover/bin/jscover
+MOCHA_OPTS =
-test:
+install:
+ @npm install
+
+test: install
@NODE_ENV=test ./node_modules/mocha/bin/mocha \
+ --bail \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
+ $(MOCHA_OPTS) \
$(TESTS)
-test-cov: lib-cov
- @FORMSTREAM_COV=1 $(MAKE) test REPORTER=dot
- @FORMSTREAM_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
+test-cov:
+ @rm -f coverage.html
+ @$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=html-cov > coverage.html
+ @$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=travis-cov
+ @ls -lh coverage.html
+
+test-coveralls:
+ @$(MAKE) test
+ @echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID)
+ @$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
-lib-cov:
- @rm -rf $@
- @$(JSCOVERAGE) lib $@
+test-all: test test-cov
-.PHONY: test-cov test lib-cov
+.PHONY: test test-cov test-all test-coveralls
View
@@ -1,12 +1,10 @@
-formstream [![Build Status](https://secure.travis-ci.org/fengmk2/formstream.png)](http://travis-ci.org/fengmk2/formstream) [![Dependencies](http://david-dm.org/fengmk2/formstream.png)](http://david-dm.org/fengmk2/formstream)
+formstream [![Build Status](https://secure.travis-ci.org/fengmk2/formstream.png)](http://travis-ci.org/fengmk2/formstream) [![Coverage Status](https://coveralls.io/repos/fengmk2/formstream/badge.png)](https://coveralls.io/r/fengmk2/formstream)
==========
![logo](https://raw.github.com/fengmk2/formstream/master/logo.png)
A [multipart/form-data](http://tools.ietf.org/html/rfc2388) encoded stream, helper for file upload.
-jscoverage: [100%](http://fengmk2.github.com/coverage/formstream.html)
-
## Install
```bash
@@ -82,7 +80,7 @@ fs.stat('./logo.png', function (err, stat) {
(The MIT License)
-Copyright (c) 2012 fengmk2 &lt;fengmk2@gmail.com&gt;
+Copyright (c) 2012 - 2013 fengmk2 &lt;fengmk2@gmail.com&gt;
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -101,4 +99,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -1 +1 @@
-module.exports = process.env.FORMSTREAM_COV ? require('./lib-cov/formstream') : require('./lib/formstream');
+module.exports = require('./lib/formstream');
View
@@ -3,12 +3,10 @@
"version": "0.0.5",
"description": "A multipart/form-data encoded stream, helper for file upload.",
"main": "index.js",
- "directories": {
- "example": "example",
- "test": "test"
- },
"scripts": {
- "test": "make test"
+ "test": "make test-all",
+ "blanket": { "pattern": "formstream/lib" },
+ "travis-cov": { "threshold": 100 }
},
"repository": {
"type": "git",
@@ -26,13 +24,16 @@
"dependencies": {
"mime": "1.2.9",
"buffer-concat": "0.0.1",
- "pause-stream": "0.0.9"
+ "pause-stream": ">=0.0.10"
},
"devDependencies": {
"connect": "*",
"should": "*",
"pedding": "*",
- "jscover": "*",
+ "blanket": "*",
+ "travis-cov": "*",
+ "coveralls": "*",
+ "mocha-lcov-reporter": "*",
"mocha": "*"
},
"author": "fengmk2 <fengmk2@gmail.com> (http://fengmk2.github.com)",
@@ -19,9 +19,9 @@ var app = connect(
for (var k in req.files) {
var f = req.files[k];
files[k] = {
- size: f.length,
- mime: f.mime,
- filename: f.filename,
+ size: f.size || f.length,
+ mime: f.type || f.mime,
+ filename: f.name || f.filename,
path: f.path
};
}
@@ -36,4 +36,4 @@ var app = connect(
}
);
-module.exports = app;
+module.exports = app;
@@ -1,6 +1,6 @@
/*!
* formstream - test/formstream.js
- * Copyright(c) 2012 fengmk2 <fengmk2@gmail.com>
+ * Copyright(c) 2012 - 2013 fengmk2 <fengmk2@gmail.com>
* MIT Licensed
*/

0 comments on commit 4ca227c

Please sign in to comment.