feat(test): add jest test suite

This commit is contained in:
Vben
2021-06-17 22:56:21 +08:00
parent 154ebc3d96
commit f6fe1dd62d
33 changed files with 1898 additions and 209 deletions

View File

@@ -0,0 +1,18 @@
import FileService from '../service/FileService';
class FileController {
private service: FileService = new FileService();
upload = async (ctx) => {
const files = ctx.request.files.file;
console.log(files);
if (files.length === undefined) {
this.service.upload(ctx, files, false);
} else {
this.service.upload(ctx, files, true);
}
};
}
export default new FileController();