feat: single mode support ignore warning (#3501)

This commit is contained in:
Yiyu He 2019-02-28 14:28:36 +08:00 committed by GitHub
parent f9eea2a4da
commit 18efac152d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -3,7 +3,9 @@
const path = require('path');
module.exports = async (options = {}) => {
console.warn('single process mode is still in experiment, please don\'t use it in production environment');
if (!options.ignoreWarning) {
console.warn('single process mode is still in experiment, please don\'t use it in production environment');
}
options.baseDir = options.baseDir || process.cwd();
options.mode = 'single';

View File

@ -46,6 +46,10 @@ describe('test/lib/start.test.js', () => {
app = await utils.singleProcessApp('apps/demo', { env: 'prod' });
assert(app.config.env === 'prod');
});
it('should ignoreWarng work', async () => {
app = await utils.singleProcessApp('apps/demo', { ignoreWaring: true });
});
});
describe('custom framework work', () => {