@openmrs/esm-active-visits-app 10.0.3-pre.8636 → 10.0.3-pre.8644

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,4 +3,4 @@
3
3
  │ 3760.js (1.714 MiB)
4
4
  
5
5
 
6
- Rspack compiled with 1 warning in 20.21 s
6
+ Rspack compiled with 1 warning in 19.53 s
package/dist/routes.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":">=2.2.0"},"extensions":[{"name":"active-visits-widget","slot":"homepage-widgets-slot","component":"activeVisits","order":0},{"name":"visit-summary-widget","slot":"visit-summary-slot","component":"visitDetail"},{"name":"active-visits-tile","slot":"home-metrics-tiles-slot","component":"homeActiveVisitsTile"},{"name":"total-visits-tile","slot":"home-metrics-tiles-slot","component":"homeTotalVisitsTile"}],"pages":[],"version":"10.0.3-pre.8636"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":">=2.2.0"},"extensions":[{"name":"active-visits-widget","slot":"homepage-widgets-slot","component":"activeVisits","order":0},{"name":"visit-summary-widget","slot":"visit-summary-slot","component":"visitDetail"},{"name":"active-visits-tile","slot":"home-metrics-tiles-slot","component":"homeActiveVisitsTile"},{"name":"total-visits-tile","slot":"home-metrics-tiles-slot","component":"homeTotalVisitsTile"}],"pages":[],"version":"10.0.3-pre.8644"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-active-visits-app",
3
- "version": "10.0.3-pre.8636",
3
+ "version": "10.0.3-pre.8644",
4
4
  "description": "Active visits widget microfrontend for O3",
5
5
  "browser": "dist/openmrs-esm-active-visits-app.js",
6
6
  "main": "src/index.ts",
@@ -14,9 +14,9 @@
14
14
  "build": "rspack --mode production",
15
15
  "analyze": "rspack --mode=production --env.analyze=true",
16
16
  "lint": "cross-env eslint src --ext ts,tsx",
17
- "test": "cross-env TZ=UTC jest --config jest.config.js --verbose false --passWithNoTests --color",
18
- "test:watch": "cross-env TZ=UTC jest --watch --config jest.config.js --color",
19
- "coverage": "yarn test --coverage",
17
+ "test": "vitest run --passWithNoTests",
18
+ "test:watch": "vitest watch",
19
+ "coverage": "vitest run --coverage --passWithNoTests",
20
20
  "typescript": "tsc",
21
21
  "extract-translations": "i18next 'src/**/*.component.tsx' 'src/**/*.resource.tsx' 'src/**/*.extension.tsx' 'src/**/*modal.tsx' 'src/**/*.workspace.tsx' 'src/index.ts' --config ../../tools/i18next-parser.config.js"
22
22
  },
@@ -50,7 +50,8 @@
50
50
  "swr": "2.x"
51
51
  },
52
52
  "devDependencies": {
53
- "openmrs": "next"
53
+ "openmrs": "next",
54
+ "vitest": "^4.1.2"
54
55
  },
55
56
  "stableVersion": "10.0.2"
56
57
  }
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { vi, describe, it, expect, test, beforeEach } from 'vitest';
2
3
  import userEvent from '@testing-library/user-event';
3
4
  import { render, screen } from '@testing-library/react';
4
5
  import { getDefaultsFromConfigSchema, type OpenmrsResource, useConfig } from '@openmrs/esm-framework';
@@ -8,14 +9,14 @@ import { type ActiveVisit, type Observation } from '../types';
8
9
  import { useActiveVisits, useObsConcepts } from './active-visits.resource';
9
10
  import ActiveVisitsTable from './active-visits.component';
10
11
 
11
- const mockUseActiveVisits = jest.mocked(useActiveVisits);
12
- const mockUseObsConcepts = jest.mocked(useObsConcepts);
13
- const mockUseConfig = jest.mocked(useConfig<ActiveVisitsConfigSchema>);
12
+ const mockUseActiveVisits = vi.mocked(useActiveVisits);
13
+ const mockUseObsConcepts = vi.mocked(useObsConcepts);
14
+ const mockUseConfig = vi.mocked(useConfig<ActiveVisitsConfigSchema>);
14
15
 
15
- jest.mock('./active-visits.resource', () => ({
16
- ...jest.requireActual('./active-visits.resource'),
17
- useActiveVisits: jest.fn(),
18
- useObsConcepts: jest.fn(),
16
+ vi.mock('./active-visits.resource', async () => ({
17
+ ...((await vi.importActual('./active-visits.resource')) as object),
18
+ useActiveVisits: vi.fn(),
19
+ useObsConcepts: vi.fn(),
19
20
  }));
20
21
 
21
22
  const mockObsConcepts: Array<OpenmrsResource> = [
@@ -1,18 +1,19 @@
1
1
  import React from 'react';
2
+ import { vi, describe, it, expect } from 'vitest';
2
3
  import userEvent from '@testing-library/user-event';
3
4
  import { render, screen } from '@testing-library/react';
4
5
  import { useVisit } from './visit.resource';
5
6
  import VisitDetailComponent from './visit-detail.component';
6
7
 
7
- const mockUseVisit = jest.mocked(useVisit);
8
+ const mockUseVisit = vi.mocked(useVisit);
8
9
  const defaultProps = {
9
10
  patientUuid: '691eed12-c0f1-11e2-94be-8c13b969e334',
10
11
  visitUuid: '497b8b17-54ec-4726-87ec-3c4da8cdcaeb',
11
12
  };
12
13
 
13
- jest.mock('./visit.resource', () => ({
14
- ...jest.requireActual('./visit.resource'),
15
- useVisit: jest.fn(),
14
+ vi.mock('./visit.resource', async () => ({
15
+ ...((await vi.importActual('./visit.resource')) as object),
16
+ useVisit: vi.fn(),
16
17
  }));
17
18
 
18
19
  describe('VisitDetail', () => {
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { vi, describe, expect, test } from 'vitest';
2
3
  import { render, screen } from '@testing-library/react';
3
4
  import { type Obs } from '@openmrs/esm-framework';
4
5
  import EncounterObservations from './encounter-observations.component';
@@ -0,0 +1,4 @@
1
+ import { mergeConfig } from 'vitest/config';
2
+ import sharedConfig from '../../tools/vitest.shared';
3
+
4
+ export default mergeConfig(sharedConfig, {});
package/jest.config.js DELETED
@@ -1,3 +0,0 @@
1
- const rootConfig = require('../../jest.config.js');
2
-
3
- module.exports = rootConfig;