make test individually runable
previously when you do something like mocha test/model.test.js you would get an error like "assert is not a function"
This commit is contained in:
parent
a0bc204159
commit
b3c43b60cd
|
@ -16,7 +16,11 @@ Token.attachTo(ds);
|
|||
var ACL = loopback.ACL;
|
||||
|
||||
describe('loopback.token(options)', function() {
|
||||
beforeEach(createTestingToken);
|
||||
var app;
|
||||
beforeEach(function(done) {
|
||||
app = loopback();
|
||||
createTestingToken.call(this, done);
|
||||
});
|
||||
|
||||
it('should populate req.token from the query string', function(done) {
|
||||
createTestAppAndRequest(this.token, done)
|
||||
|
@ -428,7 +432,9 @@ describe('AccessToken', function() {
|
|||
});
|
||||
|
||||
describe('app.enableAuth()', function() {
|
||||
var app;
|
||||
beforeEach(function setupAuthWithModels() {
|
||||
app = loopback();
|
||||
app.enableAuth({ dataSource: ds });
|
||||
});
|
||||
beforeEach(createTestingToken);
|
||||
|
|
|
@ -16,11 +16,15 @@ var expect = require('chai').expect;
|
|||
var it = require('./util/it');
|
||||
|
||||
describe('app', function() {
|
||||
var app;
|
||||
beforeEach(function() {
|
||||
app = loopback();
|
||||
});
|
||||
|
||||
describe.onServer('.middleware(phase, handler)', function() {
|
||||
var app, steps;
|
||||
var steps;
|
||||
|
||||
beforeEach(function setup() {
|
||||
app = loopback();
|
||||
steps = [];
|
||||
});
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
--require ./test/support.js
|
|
@ -4,12 +4,16 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
var async = require('async');
|
||||
var chai = require('chai');
|
||||
var describe = require('./util/describe');
|
||||
var loopback = require('../');
|
||||
var ACL = loopback.ACL;
|
||||
var defineModelTestsWithDataSource = require('./util/model-tests');
|
||||
var PersistedModel = loopback.PersistedModel;
|
||||
var sinonChai = require('sinon-chai');
|
||||
|
||||
var describe = require('./util/describe');
|
||||
var expect = chai.expect;
|
||||
chai.use(sinonChai);
|
||||
|
||||
describe('Model / PersistedModel', function() {
|
||||
defineModelTestsWithDataSource({
|
||||
|
|
|
@ -12,7 +12,6 @@ expect = require('chai').expect;
|
|||
loopback = require('../');
|
||||
memoryConnector = loopback.Memory;
|
||||
GeoPoint = loopback.GeoPoint;
|
||||
app = null;
|
||||
TaskEmitter = require('strong-task-emitter');
|
||||
request = require('supertest');
|
||||
var RemoteObjects = require('strong-remoting');
|
||||
|
@ -21,10 +20,6 @@ var RemoteObjects = require('strong-remoting');
|
|||
// for tests using the built-in User model
|
||||
loopback.User.settings.saltWorkFactor = 4;
|
||||
|
||||
beforeEach(function() {
|
||||
this.app = app = loopback();
|
||||
});
|
||||
|
||||
assertValidDataSource = function(dataSource) {
|
||||
// has methods
|
||||
assert.isFunc(dataSource, 'createModel');
|
||||
|
|
Loading…
Reference in New Issue