The old style of merging all of a function's variable declarations into a single statement made some sense back in the days of var, but there's no reason to keep doing it now that we use const and let.
31 lines
761 B
JavaScript
31 lines
761 B
JavaScript
(function() {
|
|
const path = require('path');
|
|
const glob = require('glob');
|
|
|
|
const jasmineUnderTestRequire = require(path.join(
|
|
__dirname,
|
|
'../../src/core/requireCore.js'
|
|
));
|
|
|
|
global.getJasmineRequireObj = function() {
|
|
return jasmineUnderTestRequire;
|
|
};
|
|
|
|
function getSourceFiles() {
|
|
const globs = ['../../src/core/**/*.js', '../../src/version.js'];
|
|
const srcFiles = globs.flatMap(g => glob.sync(g, { cwd: __dirname }));
|
|
|
|
for (const file of srcFiles) {
|
|
require(file);
|
|
}
|
|
}
|
|
|
|
getSourceFiles();
|
|
global.jasmineUnderTest = jasmineUnderTestRequire.core(
|
|
jasmineUnderTestRequire
|
|
);
|
|
|
|
// Alias the private namespace so tests can be less verbose
|
|
global.privateUnderTest = global.jasmineUnderTest.private;
|
|
})();
|