Skip to content
This repository was archived by the owner on Mar 4, 2019. It is now read-only.

Commit 08425d5

Browse files
committed
Added some tests for sync
1 parent b19d924 commit 08425d5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/sync_spec.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
var assert = require("assert");
2+
var Massive = require("../index");
3+
var _ = require("underscore")._;
4+
var db;
5+
6+
describe("Synchronous goodies", function(){
7+
before(function(){
8+
db = Massive.connectSync({db : "massive"});
9+
});
10+
it("loads", function(){
11+
assert(db);
12+
});
13+
it("loads our tables", function(){
14+
assert(db.tables.length > 0);
15+
});
16+
it("finds products", function(){
17+
var products = db.products.findSync();
18+
assert(products.length > 0);
19+
});
20+
it("finds a single product", function(){
21+
var product = db.products.findOneSync({id : 1});
22+
assert.equal(1,product.id);
23+
});
24+
});

0 commit comments

Comments
 (0)