Skip to content

Commit 72d33ae

Browse files
authored
test: add testcase for loadExtend with function call (#167)
It's not supported by egg, but is introduced from https://github.com/eggjs/egg-core/pull/156/files#diff-2b53c25bb02c74ba99aee993ad1980baR112 It's a bugfix in #166 rather than a break change
1 parent bb24396 commit 72d33ae

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
module.exports = app => {
4+
return {
5+
call: true,
6+
};
7+
};

test/loader/mixin/load_extend.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ describe('test/loader/mixin/load_extend.test.js', () => {
111111
assert(app.b === 'b1');
112112
});
113113

114+
it('should not load extend that returned function', function() {
115+
const proto = {};
116+
app.loader.loadExtend('call', proto);
117+
assert(proto.call === undefined);
118+
});
119+
114120
describe('load unittest extend', () => {
115121
let app;
116122
after(() => app.close());
@@ -133,4 +139,5 @@ describe('test/loader/mixin/load_extend.test.js', () => {
133139
assert(app.local === true);
134140
});
135141
});
142+
136143
});

0 commit comments

Comments
 (0)