fix(core): change proxied agent methods to native (#654)

This commit is contained in:
Junyi 2022-07-19 22:51:27 +08:00 committed by GitHub
parent a60759b2eb
commit b215f92ecc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 10 deletions

View File

@ -98,7 +98,6 @@ class DatabaseVersion {
return false; return false;
} }
const [result] = (await this.db.sequelize.query(dialects[dialect].sql)) as any; const [result] = (await this.db.sequelize.query(dialects[dialect].sql)) as any;
console.log(`db version: ${dialects[dialect].get(result?.[0]?.version)}`);
return semver.satisfies(dialects[dialect].get(result?.[0]?.version), versions[dialect]); return semver.satisfies(dialects[dialect].get(result?.[0]?.version), versions[dialect]);
} }
} }

View File

@ -121,9 +121,7 @@ export class MockServer extends Application {
return proxy; return proxy;
}; };
} }
return (...args: any[]) => { return agent[method];
return agent[method](...args);
};
}, },
}); });
return proxy as any; return proxy as any;

View File

@ -1,11 +1,11 @@
export function requireModule(module: any) { export function requireModule(m: any) {
if (typeof module === 'string') { if (typeof m === 'string') {
module = require(module); m = require(m);
} }
if (typeof module !== 'object') { if (typeof m !== 'object') {
return module; return m;
} }
return module.__esModule ? module.default : module; return m.__esModule ? m.default : m;
} }
export default requireModule; export default requireModule;