Skip to content

Commit

Permalink
feat: single mode support ignore warning (#3501)
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-horse authored Feb 28, 2019
1 parent f9eea2a commit 18efac1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 4 additions & 0 deletions test/lib/start.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 18efac1

Please sign in to comment.