Skip to content

Commit

Permalink
[fix] last doc changes and add test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Swaagie committed Jun 5, 2014
1 parent 7ef02b4 commit c7d90d6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -14,3 +14,4 @@ results
npm-debug.log
node_modules
exceptions
.coveralls.yml
11 changes: 6 additions & 5 deletions README.md
@@ -1,4 +1,8 @@
# Fossa
# Fossa [![Build Status][status]](https://travis-ci.org/observing/fossa) [![NPM version][npmimgurl]](http://npmjs.org/package/fossa) [![Coverage Status][coverage]](http://coveralls.io/r/observing/fossa?branch=master)

[status]: https://travis-ci.org/observing/fossa.png?branch=master
[npmimgurl]: https://badge.fury.io/js/fossa.png
[coverage]: http://coveralls.io/repos/observing/fossa/badge.png?branch=master

Backbone powered model interface to MongoDB, thin wrapper around MongoDB. Fossa
uses the API provided by [Backbone][backbone] and proxies it methods to the
Expand Down Expand Up @@ -33,6 +37,7 @@ methods see the [BackboneJS documentation][backbone].
- [Object.define](#objectdefine)
- [Object.setup](#objectsetup)

**Instances**
- [Collection](#collection)
- [Model](#model)

Expand Down Expand Up @@ -161,8 +166,6 @@ var Accounts = fossa.Collection.extend({
var accounts = new Accounts;
```

#### Collection TOC

**Fossa.Collection properties**
- [Collection.model](#collectionmodel)
- [Collection._database](#collection-database)
Expand Down Expand Up @@ -241,8 +244,6 @@ var User = fossa.Model.extend({
});
```

#### Model TOC

**Fossa.Model properties**
- [Model.idAttribute](#modelidAttribute)
- [Model._stored](#modelstored)
Expand Down
22 changes: 13 additions & 9 deletions package.json
@@ -1,10 +1,11 @@
{
"name": "fossa",
"version": "0.0.0",
"version": "0.1.0",
"description": "Backbone powered model interface to MongoDB, thin wrapper around MongoJS",
"main": "index.js",
"scripts": {
"test": "NODE_ENV=testing ./node_modules/.bin/mocha $(find test -name '*.test.js')"
"test": "NODE_ENV=test ./node_modules/.bin/mocha $(find test -name '*.test.js')",
"coverage": "NODE_ENV=test ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js || true && rm -rf ./coverage"
},
"repository": {
"type": "git",
Expand All @@ -26,16 +27,19 @@
},
"dependencies": {
"backbone": "~1.1.0",
"mongodb": "~1.3.0",
"mongodb": "~1.4.5",
"lodash": "~2.4.0",
"async": "~0.2.0",
"predefine": "~0.0.0"
"async": "~0.9.0",
"predefine": "~0.1.1"
},
"devDependencies": {
"chai": "~1.8.0",
"mocha": "~1.17.0",
"coveralls": "~2.10.0",
"mocha-lcov-reporter": "~0.0.1",
"istanbul": "~0.2.6",
"chai": "~1.9.1",
"mocha": "~1.20.0",
"pre-commit": "~0.0.0",
"sinon": "~1.7.0",
"sinon-chai": "~2.4.0"
"sinon": "~1.10.2",
"sinon-chai": "~2.5.0"
}
}
8 changes: 4 additions & 4 deletions test/model.test.js
Expand Up @@ -138,7 +138,7 @@ describe('Fossa Model', function () {
.use('fossa')
.sync('update')
.done(function synced(err, result) {
expect(err).to.equal(null);
expect(err).to.equal(undefined);
expect(result).to.equal(0);
expect(model._stored).to.equal(false);
done();
Expand Down Expand Up @@ -188,7 +188,7 @@ describe('Fossa Model', function () {
model
.sync('delete')
.done(function deleted(err, n) {
expect(err).to.equal(null);
expect(err).to.equal(undefined);
expect(n).to.equal(1);
db.collection('users').findOne({ _id: model.id }, function (err, item) {
expect(err).to.equal(null);
Expand Down Expand Up @@ -245,7 +245,7 @@ describe('Fossa Model', function () {
.sync()
.done(function synced(err, result) {
model.destroy().done(function deleted(err, n) {
expect(err).to.equal(null);
expect(err).to.equal(undefined);
expect(n).to.equal(1);
done();
});
Expand All @@ -260,7 +260,7 @@ describe('Fossa Model', function () {
.define('urlRoot','users')
.use('fossa')
.destroy().done(function deleted(err, n) {
expect(err).to.equal(null);
expect(err).to.equal(undefined);
expect(n).to.equal(0);
done();
});
Expand Down

0 comments on commit c7d90d6

Please sign in to comment.