2015-10-27 13:59:15 -07:00
|
|
|
/* Copyright 2015 Realm Inc - All Rights Reserved
|
|
|
|
* Proprietary and Confidential
|
|
|
|
*/
|
2015-10-02 14:57:54 -07:00
|
|
|
|
2015-10-06 00:57:35 -07:00
|
|
|
'use strict';
|
2015-10-02 15:15:25 -07:00
|
|
|
|
2015-12-09 15:49:43 -08: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-14 18:52:55 -07:00
|
|
|
|
2015-10-15 11:34:24 -07:00
|
|
|
var SPECIAL_METHODS = {
|
|
|
|
beforeEach: true,
|
|
|
|
afterEach: true,
|
|
|
|
};
|
|
|
|
|
2015-12-30 16:47:16 -08:00
|
|
|
// Only the test suites should be iterable members of exports.
|
|
|
|
Object.defineProperties(exports, {
|
|
|
|
getTestNames: {
|
|
|
|
value: function() {
|
|
|
|
var testNames = {};
|
2015-10-15 11:34:24 -07:00
|
|
|
|
2015-12-30 16:47:16 -08:00
|
|
|
for (var suiteName in exports) {
|
|
|
|
var testSuite = exports[suiteName];
|
2015-10-15 11:34:24 -07:00
|
|
|
|
2015-12-30 16:47:16 -08:00
|
|
|
testNames[suiteName] = Object.keys(testSuite).filter(function(testName) {
|
|
|
|
return !(testName in SPECIAL_METHODS) && typeof testSuite[testName] == 'function';
|
|
|
|
});
|
|
|
|
}
|
2015-10-15 11:34:24 -07:00
|
|
|
|
2015-12-30 16:47:16 -08:00
|
|
|
return testNames;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
runTest: {
|
|
|
|
value: function(suiteName, testName) {
|
|
|
|
exports[suiteName][testName]();
|
|
|
|
}
|
|
|
|
},
|
2015-10-15 11:34:24 -07:00
|
|
|
});
|