forked from balderdashy/waterline
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexandre Tiertant
committed
Apr 17, 2018
1 parent
d4b760b
commit a403845
Showing
10 changed files
with
107 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ node_modules | |
nbproject/ | ||
coverage/ | ||
npm-debug.log | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ CONTRIBUTING.md | |
*.swm | ||
.editorconfig | ||
example | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
language: node_js | ||
node_js: | ||
- "4" | ||
- "6" | ||
- "8" | ||
- '4' | ||
- '6' | ||
- '8' | ||
- '9' | ||
|
||
after_script: | ||
- npm run coverage && cat ./coverage/lcov.info | ./node_modules/.bin/codeclimate | ||
addons: | ||
code_climate: | ||
repo_token: 351483555263cf9bcd2416c58b0e0ae6ca1b32438aa51bbab2c833560fb67cc0 | ||
sudo: false | ||
after_success: | ||
- npm run coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var util = require('util'); | ||
process.env.offshorePath = path.join(__dirname, '..'); | ||
var TestRunner = require('offshore-adapter-tests'); | ||
var Mocha = require('mocha'); | ||
|
||
var mocha = new Mocha(); | ||
|
||
(function getTestFiles(dir) { | ||
files = fs.readdirSync(dir); | ||
files.forEach(function(file) { | ||
if (fs.statSync(path.join(dir, file)).isDirectory()) { | ||
return getTestFiles(path.join(dir, file)); | ||
} | ||
mocha.addFile(path.join(dir, file)); | ||
}); | ||
})(__dirname); | ||
|
||
mocha.run(function(failures) { | ||
if (failures) { | ||
process.on('exit', function() { | ||
process.exit(failures); | ||
}); | ||
} else { | ||
var adapterName = 'offshore-memory'; | ||
var Adapter = require(adapterName); | ||
|
||
// Grab targeted interfaces from this adapter's `package.json` file: | ||
var package = {}; | ||
var interfaces = []; | ||
var features = []; | ||
try { | ||
package = require('../node_modules/' + adapterName + '/package.json'); | ||
interfaces = package['offshoreAdapter'].interfaces; | ||
features = package.offshoreAdapter.features; | ||
} | ||
catch (e) { | ||
throw new Error( | ||
'\n'+ | ||
'Could not read supported interfaces from "offshore-adapter"."interfaces"'+'\n' + | ||
'in this adapter\'s `package.json` file ::' + '\n' + | ||
util.inspect(e) | ||
); | ||
} | ||
|
||
console.info('Testing `' + package.name + '`, an offshore adapter.'); | ||
console.info('Running `offshore-adapter-tests` against ' + interfaces.length + ' interfaces...'); | ||
console.info('( ' + interfaces.join(', ') + ' )'); | ||
console.log(); | ||
|
||
/** | ||
* Integration Test Runner | ||
* | ||
* Uses the `offshore-adapter-tests` module to | ||
* run mocha tests against the specified interfaces | ||
* of the currently-implemented Offshore adapter API. | ||
*/ | ||
new TestRunner({ | ||
|
||
// Load the adapter module. | ||
adapter: Adapter, | ||
|
||
// Default adapter config to use. | ||
config: { | ||
schema: false | ||
}, | ||
|
||
// The set of adapter interfaces to test against. | ||
// (grabbed these from this adapter's package.json file above) | ||
interfaces: interfaces, | ||
|
||
// The set of adapter features to test against. | ||
// (grabbed these from this adapter's package.json file above) | ||
features: features, | ||
|
||
// Mocha options | ||
// reference: https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically | ||
mocha: { | ||
reporter: 'spec' | ||
}, | ||
|
||
mochaChainableMethods: {}, | ||
|
||
// Return code 1 if any test failed | ||
failOnError: true | ||
}); | ||
|
||
} | ||
|
||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.