1 | const assert = require('assert');
|
2 | const path = require('path');
|
3 | const mock = require('./index').default;
|
4 | const appHandler = require('./lib/app_handler');
|
5 |
|
6 | const { getEggOptions } = require('./lib/utils');
|
7 |
|
8 | const options = getEggOptions();
|
9 |
|
10 |
|
11 | const pkgInfo = require(path.join(options.baseDir || process.cwd(), 'package.json'));
|
12 | if (pkgInfo.eggPlugin) throw new Error('DO NOT USE bootstrap to test plugin');
|
13 |
|
14 | appHandler.setupApp();
|
15 |
|
16 | module.exports = {
|
17 | assert,
|
18 | get app() {
|
19 | return appHandler.getBootstrapApp();
|
20 | },
|
21 | mock,
|
22 | mm: mock,
|
23 | };
|