mirror of
https://github.com/wekan/wekan.git
synced 2026-11-05 21:44:59 -05:00
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 !
25 lines
924 B
JavaScript
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)));
|
|
};
|