2015-10-27 20:59:15 +00:00
|
|
|
/* Copyright 2015 Realm Inc - All Rights Reserved
|
|
|
|
* Proprietary and Confidential
|
|
|
|
*/
|
2015-10-02 21:57:54 +00:00
|
|
|
|
2015-10-06 07:57:35 +00:00
|
|
|
'use strict';
|
2015-10-02 22:15:25 +00:00
|
|
|
|
2015-12-09 23:49:43 +00:00
|
|
|
exports.ListTests = require('./list-tests');
|
|
|
|
exports.ObjectTests = require('./object-tests');
|
|
|
|
exports.RealmTests = require('./realm-tests');
|
|
|
|
exports.ResultsTests = require('./results-tests');
|
|
|
|
exports.QueryTests = require('./query-tests');
|
2015-10-15 01:52:55 +00:00
|
|
|
|
2015-10-15 18:34:24 +00:00
|
|
|
var SPECIAL_METHODS = {
|
|
|
|
beforeEach: true,
|
|
|
|
afterEach: true,
|
|
|
|
};
|
|
|
|
|
2015-12-31 00:47:16 +00:00
|
|
|
// Only the test suites should be iterable members of exports.
|
|
|
|
Object.defineProperties(exports, {
|
|
|
|
getTestNames: {
|
|
|
|
value: function() {
|
|
|
|
var testNames = {};
|
2015-10-15 18:34:24 +00:00
|
|
|
|
2015-12-31 00:47:16 +00:00
|
|
|
for (var suiteName in exports) {
|
|
|
|
var testSuite = exports[suiteName];
|
2015-10-15 18:34:24 +00:00
|
|
|
|
2015-12-31 00:47:16 +00:00
|
|
|
testNames[suiteName] = Object.keys(testSuite).filter(function(testName) {
|
|
|
|
return !(testName in SPECIAL_METHODS) && typeof testSuite[testName] == 'function';
|
|
|
|
});
|
|
|
|
}
|
2015-10-15 18:34:24 +00:00
|
|
|
|
2015-12-31 00:47:16 +00:00
|
|
|
return testNames;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
runTest: {
|
|
|
|
value: function(suiteName, testName) {
|
|
|
|
exports[suiteName][testName]();
|
|
|
|
}
|
|
|
|
},
|
2015-10-15 18:34:24 +00:00
|
|
|
});
|