jest.config.ts 516 B

1234567891011121314151617181920212223
  1. import { configUmiAlias, createConfig } from '@umijs/max/test';
  2. export default async () => {
  3. const config = await configUmiAlias({
  4. ...createConfig({
  5. target: 'browser',
  6. }),
  7. });
  8. console.log();
  9. return {
  10. ...config,
  11. testEnvironmentOptions: {
  12. ...(config?.testEnvironmentOptions || {}),
  13. url: 'http://localhost:8000',
  14. },
  15. setupFiles: [...(config.setupFiles || []), './tests/setupTests.jsx'],
  16. globals: {
  17. ...config.globals,
  18. localStorage: null,
  19. },
  20. };
  21. };