Skip to content

Get tests to run. #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"devDependencies": {
"mocha": "~1.13.0",
"waterline-adapter-tests": "~0.10.0",
"waterline-adapter-tests": "~0.10.7",
"captains-log": "~0.11.1"
},
"waterlineAdapter": {
Expand All @@ -38,7 +38,8 @@
"semantic",
"queryable",
"associations"
]
],
"features": []
},
"bugs": {
"url": "https://github.com/gadelkareem/sails-dynamodb/issues"
Expand Down
37 changes: 16 additions & 21 deletions test/integration/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,26 @@ var util = require('util');
var mocha = require('mocha');
var log = new (require('captains-log'))();


var TestRunner = require('waterline-adapter-tests');
var Adapter = require('../../');



// Grab targeted interfaces from this adapter's `package.json` file:
var package = {};
var interfaces = [];
try {
package = require('root-require')('package.json');
interfaces = package['sailsAdapter'].implements;
package = require('../../package.json');
interfaces = package.waterlineAdapter.interfaces;
features = package.waterlineAdapter.features;
}
catch (e) {
throw new Error(
'\n'+
'Could not read supported interfaces from "sails-adapter"."interfaces"'+'\n' +
'in this adapter\'s `package.json` file ::' + '\n' +
util.inspect(e)
);
util.inspect(e));
}





log.info('Testing `' + package.name + '`, a Sails adapter.');
log.info('Running `waterline-adapter-tests` against ' + interfaces.length + ' interfaces...');
log.info('( ' + interfaces.join(', ') + ' )');
Expand All @@ -40,8 +34,6 @@ log('https://github.com/balderdashy/sails-docs/blob/master/adapter-specification
console.log();




/**
* Integration Test Runner
*
Expand All @@ -54,30 +46,33 @@ new TestRunner({
// Load the adapter module.
adapter: Adapter,

// Default adapter config to use.
config: {
schema: false
mocha: {
bail: true
},

// Default adapter config to use.
config: {},

// The set of adapter interfaces to test against.
// (grabbed these from this adapter's package.json file above)
interfaces: interfaces

interfaces: interfaces,
features: features

// Most databases implement 'semantic' and 'queryable'.
//
//
// As of Sails/Waterline v0.10, the 'associations' interface
// is also available. If you don't implement 'associations',
// it will be polyfilled for you by Waterline core. The core
// implementation will always be used for cross-adapter / cross-connection
// joins.
//
//
// In future versions of Sails/Waterline, 'queryable' may be also
// be polyfilled by core.
//
//
// These polyfilled implementations can usually be further optimized at the
// adapter level, since most databases provide optimizations for internal
// operations.
//
//
// Full interface reference:
// https://github.com/balderdashy/sails-docs/blob/master/adapter-specification.md
});