-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import mm from 'egg-mock'; | ||
import assert from 'assert'; | ||
import path from 'path'; | ||
|
||
describe('test/DuplicateOptionalModule.test.ts', () => { | ||
let app; | ||
const fixturesPath = path.join(__dirname, './fixtures/apps/duplicate-optional-module'); | ||
|
||
after(async () => { | ||
await app.close(); | ||
}); | ||
|
||
afterEach(() => { | ||
mm.restore(); | ||
}); | ||
|
||
before(async () => { | ||
mm(process.env, 'EGG_TYPESCRIPT', true); | ||
mm(process, 'cwd', () => { | ||
return path.join(__dirname, '..'); | ||
}); | ||
app = mm.app({ | ||
baseDir: fixturesPath, | ||
framework: require.resolve('egg'), | ||
}); | ||
await app.ready(); | ||
}); | ||
|
||
it('should work', async () => { | ||
console.log('app.moduleReferences: ', app.moduleReferences); | ||
assert.equal(app.moduleReferences.length, 3); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { SingletonProto, Inject } from 'core/core-decorator'; | ||
Check failure on line 1 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-ubuntu (20)
Check failure on line 1 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-ubuntu (18)
Check failure on line 1 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-ubuntu (16)
Check failure on line 1 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-windows (16)
Check failure on line 1 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-ubuntu (14)
Check failure on line 1 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-windows (20)
Check failure on line 1 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-windows (14)
Check failure on line 1 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-windows (18)
Check failure on line 1 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-macos (16)
Check failure on line 1 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-macos (14)
Check failure on line 1 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-macos (20)
|
||
import { UsedProto } from 'used/Used'; | ||
Check failure on line 2 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-ubuntu (20)
Check failure on line 2 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-ubuntu (18)
Check failure on line 2 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-ubuntu (16)
Check failure on line 2 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-windows (16)
Check failure on line 2 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-ubuntu (14)
Check failure on line 2 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-windows (20)
Check failure on line 2 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-windows (14)
Check failure on line 2 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-windows (18)
Check failure on line 2 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-macos (16)
Check failure on line 2 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-macos (14)
Check failure on line 2 in plugin/config/test/fixtures/apps/duplicate-optional-module/app/modules/root/Root.ts GitHub Actions / Runner-macos (20)
|
||
|
||
@SingletonProto() | ||
export class RootProto { | ||
@Inject() usedProto: UsedProto; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "root", | ||
"eggModule": { | ||
"name": "root" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
|
||
const path = require('path'); | ||
|
||
module.exports = function(appInfo) { | ||
const config = { | ||
keys: 'test key', | ||
customLogger: { | ||
xxLogger: { | ||
file: path.join(appInfo.root, 'logs/xx.log'), | ||
}, | ||
}, | ||
security: { | ||
csrf: { | ||
ignoreJSON: false, | ||
} | ||
}, | ||
}; | ||
return config; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use strict'; | ||
|
||
exports.tracer = { | ||
package: 'egg-tracer', | ||
enable: true, | ||
}; | ||
|
||
exports.watcher = false; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "egg-app", | ||
"egg": { | ||
"framework": "foo" | ||
}, | ||
"dependencies": { | ||
"used": "*" | ||
} | ||
} |