Files
Lauri Ojansivu b104edeef1 Add source-loaded development server and sequential EVERYTHING testing
Add Dev server nobuild to both build menus with shared URL and port options. Load checkout JavaScript and templates in memory using the installed Meteor toolchain; start its bundled MongoDB on the next port and wait for owned database shutdown.

Run server, Node, import, E2E and all supported Chromium, Firefox and WebKit regressions sequentially, stopping on failure. Preserve CommonJS semantics, native fetch, dynamic import namespaces and client source access boundaries. Document verified results and the remaining Windows and intermittent Firefox limits.

Thanks to xet7 !
2026-09-20 05:37:00 +03:00

25 lines
924 B
JavaScript

'use strict';
const path = require('node:path');
// Run the existing Meteor server entry in this source-loaded process, with the
// same installed Mocha version as meteortesting:mocha-core. No test copy or
// second Meteor build is involved.
module.exports = async function runServerTests({
root,
packagePath,
versions
}) {
const Mocha = require(path.join(packagePath('meteortesting:mocha-core', versions['meteortesting:mocha-core']), 'npm/node_modules/mocha'));
const mocha = new Mocha({
reporter: 'spec',
timeout: 10000,
bail: process.env.WEKAN_TEST_BAIL === '1'
});
if (process.env.MOCHA_GREP) mocha.grep(process.env.MOCHA_GREP);
mocha.suite.emit('pre-require', global, path.join(root, 'server/lib/tests/index.js'), mocha);
Meteor.isTest = true;
require(path.join(root, 'server/lib/tests/index.js'));
return new Promise(resolve => mocha.run(failures => resolve(failures ? 1 : 0)));
};