From 43f395d6535876da5507fd2744f5fddeeb719d44 Mon Sep 17 00:00:00 2001 From: Anatoliy Chakkaev Date: Sat, 6 Apr 2013 14:57:12 +0400 Subject: [PATCH] Manually require init --- Makefile | 2 +- test/adapters_test.js | 10 ---------- test/basic-querying.test.js | 4 +++- test/datatype.test.js | 8 +++++--- test/defaults.test.js | 3 +++ test/hooks.test.js | 4 +++- test/include.test.js | 5 ++++- test/init.js | 2 +- test/json.test.js | 4 +++- test/jugglingdb.test.js | 3 +++ test/manipulation.test.js | 5 ++++- test/relations.test.js | 5 ++++- test/schema.test.js | 4 +++- test/validations.test.js | 4 +++- 14 files changed, 40 insertions(+), 23 deletions(-) delete mode 100644 test/adapters_test.js diff --git a/Makefile b/Makefile index c10bb085..11f76259 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ ## TESTS TESTER = ./node_modules/.bin/mocha -OPTS = --require ./test/init.js --growl +OPTS = --growl TESTS = test/*.test.js test: diff --git a/test/adapters_test.js b/test/adapters_test.js deleted file mode 100644 index f9721081..00000000 --- a/test/adapters_test.js +++ /dev/null @@ -1,10 +0,0 @@ -var jdb = require('../'), - Schema = jdb.Schema, - test = jdb.test; - -var schema = new Schema('memory'); - -test(module.exports, schema); - -test.skip('hasMany should be cached'); - diff --git a/test/basic-querying.test.js b/test/basic-querying.test.js index 63067e90..15a8f2af 100644 --- a/test/basic-querying.test.js +++ b/test/basic-querying.test.js @@ -1,4 +1,6 @@ -var db, User, should = require('should'); +// This test written in mocha+should.js +var should = require('./init.js'); +var db, User; describe('basic-querying', function() { diff --git a/test/datatype.test.js b/test/datatype.test.js index cdc0202f..68499aeb 100644 --- a/test/datatype.test.js +++ b/test/datatype.test.js @@ -1,7 +1,9 @@ -var db, Model; -var should = require('should'); +// This test written in mocha+should.js +var should = require('./init.js'); -describe.only('datatypes', function() { +var db, Model; + +describe('datatypes', function() { before(function(done){ db = getSchema(); diff --git a/test/defaults.test.js b/test/defaults.test.js index 673b8f7f..8b08f4c0 100644 --- a/test/defaults.test.js +++ b/test/defaults.test.js @@ -1,3 +1,6 @@ +// This test written in mocha+should.js +var should = require('./init.js'); + var db = getSchema(); describe('defaults', function() { diff --git a/test/hooks.test.js b/test/hooks.test.js index 0ce5315d..d853368b 100644 --- a/test/hooks.test.js +++ b/test/hooks.test.js @@ -1,5 +1,7 @@ +// This test written in mocha+should.js +var should = require('./init.js'); + var j = require('../'), - should = require('should'), Schema = j.Schema, AbstractClass = j.AbstractClass, Hookable = j.Hookable, diff --git a/test/include.test.js b/test/include.test.js index 53378b65..e397d30d 100644 --- a/test/include.test.js +++ b/test/include.test.js @@ -1,4 +1,7 @@ -var db, User, Post, Passport, City, Street, Building, should = require('should'); +// This test written in mocha+should.js +var should = require('./init.js'); + +var db, User, Post, Passport, City, Street, Building; var nbSchemaRequests = 0; describe('include', function() { diff --git a/test/init.js b/test/init.js index 99748e50..5c6a6109 100644 --- a/test/init.js +++ b/test/init.js @@ -1,4 +1,4 @@ -require('should'); +module.exports = require('should'); if (!process.env.TRAVIS) { if (typeof __cov === 'undefined') { diff --git a/test/json.test.js b/test/json.test.js index ce9aabb0..2c3c419b 100644 --- a/test/json.test.js +++ b/test/json.test.js @@ -1,5 +1,7 @@ +// This test written in mocha+should.js +var should = require('./init.js'); + var Schema = require('../').Schema; -var should = require('should'); describe('JSON property', function() { var schema, Model; diff --git a/test/jugglingdb.test.js b/test/jugglingdb.test.js index dc80dfdb..e1d1e97a 100644 --- a/test/jugglingdb.test.js +++ b/test/jugglingdb.test.js @@ -1,3 +1,6 @@ +// This test written in mocha+should.js +var should = require('./init.js'); + var jugglingdb = require('../'); describe('jugglingdb', function() { diff --git a/test/manipulation.test.js b/test/manipulation.test.js index 170d9af5..3ee1c35e 100644 --- a/test/manipulation.test.js +++ b/test/manipulation.test.js @@ -1,4 +1,7 @@ -var db, Person, should = require('should'); +// This test written in mocha+should.js +var should = require('./init.js'); + +var db, Person; describe('manipulation', function() { diff --git a/test/relations.test.js b/test/relations.test.js index 5628cd57..f97cc3d4 100644 --- a/test/relations.test.js +++ b/test/relations.test.js @@ -1,4 +1,7 @@ -var db, Book, Chapter, Author, Reader, should = require('should'); +// This test written in mocha+should.js +var should = require('./init.js'); + +var db, Book, Chapter, Author, Reader; describe('relations', function() { before(function(done) { diff --git a/test/schema.test.js b/test/schema.test.js index d26d2fad..5701fc03 100644 --- a/test/schema.test.js +++ b/test/schema.test.js @@ -1,5 +1,7 @@ +// This test written in mocha+should.js +var should = require('./init.js'); + var db = getSchema(), slave = getSchema(), Model, SlaveModel; -var should = require('should'); describe('schema', function() { diff --git a/test/validations.test.js b/test/validations.test.js index 7faa9c02..561d3b8c 100644 --- a/test/validations.test.js +++ b/test/validations.test.js @@ -1,6 +1,8 @@ +// This test written in mocha+should.js +var should = require('./init.js'); + var j = require('../'), db, User; var ValidationError = require('../lib/validations.js').ValidationError; -var should = require('should'); function getValidAttributes() { return {