Skip to content

Commit

Permalink
Rollback setupTests
Browse files Browse the repository at this point in the history
Ref: #60
  • Loading branch information
projkov committed Nov 27, 2023
1 parent cccebc5 commit de1d05f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions shared/src/setupTests.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import {
axiosInstance as aidboxInstance,
axiosInstance,
resetInstanceToken as resetAidboxInstanceToken,
setInstanceBaseURL as setAidboxInstanceBaseURL,
} from 'aidbox-react/lib/services/instance';
import { withRootAccess } from 'aidbox-react/lib/utils/tests';

import { setInstanceBaseURL as setFHIRInstanceBaseURL } from 'fhir-react/lib/services/instance';
import {
resetInstanceToken as resetFHIRInstanceToken,
setInstanceBaseURL as setFHIRInstanceBaseURL,
} from 'fhir-react/lib/services/instance';

beforeAll(async () => {
setAidboxInstanceBaseURL('http://localhost:8181');
Expand All @@ -15,7 +19,7 @@ let txId: string;

beforeEach(async () => {
await withRootAccess(async () => {
const response = await aidboxInstance({
const response = await axiosInstance({
method: 'POST',
url: '/$psql',
data: { query: 'SELECT last_value from transaction_id_seq;' },
Expand All @@ -27,8 +31,10 @@ beforeEach(async () => {
});

afterEach(async () => {
resetAidboxInstanceToken();
resetFHIRInstanceToken();
await withRootAccess(async () => {
await aidboxInstance({
await axiosInstance({
method: 'POST',
url: '/$psql',
data: { query: `select drop_before_all(${txId});` },
Expand Down

0 comments on commit de1d05f

Please sign in to comment.