Skip to content

Commit 0ab4afd

Browse files
fix: correct error message assertion in unit test
1 parent 50bcd1c commit 0ab4afd

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

packages/sdk/tests/e2e/dataProtectorCore/getGrantedAccess.test.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { describe, it, expect, beforeAll, jest } from '@jest/globals';
1+
import { describe, it, expect, beforeAll } from '@jest/globals';
22
import { HDNodeWallet, Wallet } from 'ethers';
33
import { IExec } from 'iexec';
4-
import BN from 'bn.js';
54
import { IExecDataProtectorCore } from '../../../src/index.js';
65
import {
76
MAX_EXPECTED_BLOCKTIME,
@@ -23,10 +22,13 @@ async function consumeProtectedDataOrder(
2322
secrets: Record<number, string>,
2423
args: string
2524
) {
26-
const datasetOrderbook = await iexec.orderbook.fetchDatasetOrderbook(protectedData, {
27-
app: app,
28-
requester: await iexec.wallet.getAddress(),
29-
});
25+
const datasetOrderbook = await iexec.orderbook.fetchDatasetOrderbook(
26+
protectedData,
27+
{
28+
app: app,
29+
requester: await iexec.wallet.getAddress(),
30+
}
31+
);
3032
const datasetOrder = datasetOrderbook.orders[0]?.order;
3133
if (!datasetOrder) {
3234
throw new Error('No dataset order found');
@@ -132,8 +134,8 @@ describe('dataProtectorCore.getGrantedAccess()', () => {
132134
res.forEach((grantedAccess) => {
133135
expect(
134136
grantedAccess.apprestrict === authorizedApp ||
135-
grantedAccess.apprestrict ===
136-
'0x0000000000000000000000000000000000000000'
137+
grantedAccess.apprestrict ===
138+
'0x0000000000000000000000000000000000000000'
137139
).toBe(true);
138140
});
139141
},
@@ -152,8 +154,8 @@ describe('dataProtectorCore.getGrantedAccess()', () => {
152154
res.forEach((grantedAccess) => {
153155
expect(
154156
grantedAccess.requesterrestrict === authorizedUser ||
155-
grantedAccess.requesterrestrict ===
156-
'0x0000000000000000000000000000000000000000'
157+
grantedAccess.requesterrestrict ===
158+
'0x0000000000000000000000000000000000000000'
157159
).toBe(true);
158160
});
159161
},
@@ -188,7 +190,7 @@ describe('dataProtectorCore.getGrantedAccess()', () => {
188190
(contact) =>
189191
contact.apprestrict.toLowerCase() === sconeAppAddress.toLowerCase() &&
190192
contact.requesterrestrict.toLowerCase() ===
191-
userWalletAddress.toLowerCase()
193+
userWalletAddress.toLowerCase()
192194
);
193195
expect(result[0]).toEqual(grantedAccess);
194196
},
@@ -556,7 +558,9 @@ describe('dataProtectorCore.getGrantedAccess()', () => {
556558
});
557559

558560
// revoke all access - removes all dataset orders
559-
await dataProtectorCore.revokeAllAccess({ protectedData: protectedData.address });
561+
await dataProtectorCore.revokeAllAccess({
562+
protectedData: protectedData.address,
563+
});
560564

561565
// check that no orders remain
562566
const { grantedAccess: accessAfterRevoke } =

packages/sdk/tests/unit/dataProtectorCore/getGrantedAccess.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ describe('getGrantedAccess', () => {
156156
).rejects.toThrow(
157157
new WorkflowError({
158158
message: 'Failed to fetch granted access',
159-
errorCause: new Error('orders?.map is not a function'),
159+
errorCause: new Error('orders.map is not a function'),
160160
})
161161
);
162162
});

0 commit comments

Comments
 (0)