test.spec.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. import {MyRouter} from "@src/MyRouter";
  2. import {Models} from "@src/models/Models";
  3. import {ServiceApp} from "@core/App";
  4. import path from "path";
  5. import {acs_module_test} from "@root/pmr-access-control/__test/acs_module.test";
  6. import {acs_application_test} from "@root/pmr-access-control/__test/acs_application.test";
  7. import {acs_function_test} from "@root/pmr-access-control/__test/acs_function.test";
  8. import {acs_domain_test} from "@root/pmr-access-control/__test/acs_domain.test";
  9. import {acs_role_test} from "@root/pmr-access-control/__test/acs_role.test";
  10. import {acs_user_test} from "@root/pmr-access-control/__test/acs_user.test";
  11. const globalAny: any = global;
  12. describe('siot test', () => {
  13. process.env.TEST = 'true';
  14. globalAny.user_id = 'admin';
  15. beforeAll(async () => {
  16. let svr = new ServiceApp(path.join(process.cwd(), "config_test.json"));
  17. await svr.start(new MyRouter('@src/routes', []), Models, undefined, true);
  18. globalAny.app = svr.app;
  19. globalAny.svr = svr;
  20. }, 30000);
  21. afterAll(async () => {
  22. globalAny.svr.stopSvr();
  23. })
  24. // describe('应用管理', acs_application_test);
  25. // describe('功能模块管理', acs_module_test);
  26. // describe('功能项管理', acs_function_test);
  27. // describe('组织机构管理', acs_domain_test);
  28. // describe('角色管理', acs_role_test);
  29. describe('用户管理', acs_user_test);
  30. });