Skip to content
Browse files

Added query unit tests

  • Loading branch information...
1 parent 2d014df commit f3c32d4442d91aa62cfd76f6d7f52fd72d8a210b @tommy351 committed Sep 4, 2012
Showing with 52 additions and 0 deletions.
  1. +52 −0 test/query.js
View
52 test/query.js
@@ -0,0 +1,52 @@
+var qfs = require('..'),
+ path = require('path'),
+ dirname = __dirname,
+ filename = __filename;
+
+describe('Query', function(){
+ it('children()', function(done){
+ qfs(dirname).children().should.be.an.instanceof(qfs);
+
+ done();
+ });
+
+ it('children() - async', function(done){
+ qfs(dirname).children(function(err, files){
+ files.should.be.an.instanceof(qfs);
+ });
+
+ done();
+ });
+
+ it('siblings()', function(done){
+ qfs(filename).siblings().should.be.an.instanceof(qfs);
+
+ done();
+ });
+
+ it('siblings() - async', function(done){
+ qfs(filename).siblings(function(err, files){
+ files.should.be.an.instanceof(qfs);
+ });
+
+ done();
+ });
+
+ it('parent()', function(done){
+ qfs(filename).parent().should.be.an.instanceof(qfs);
+
+ done();
+ });
+
+ it('parents()', function(done){
+ qfs(filename).parents().should.be.an.instanceof(qfs);
+
+ done();
+ });
+
+ it('parentsUntil()', function(done){
+ qfs(filename).parentsUntil('qfs').should.be.an.instanceof(qfs);
+
+ done();
+ });
+});

0 comments on commit f3c32d4

Please sign in to comment.
Something went wrong with that request. Please try again.