Skip to content

Commit 5946303

Browse files
committed
fix: update IExecDataProtector instantiation to use getTestConfig for improved test setup
1 parent 1a30d72 commit 5946303

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/sdk/tests/e2e/constructor.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { describe, it, expect } from '@jest/globals';
22
import { IExecDataProtector } from '../../src/index.js';
3+
import { getTestConfig } from '../test-utils.js';
34

45
describe('When instantiating SDK without a signer', () => {
56
describe('When calling a read method', () => {
67
it('should work as expected', async () => {
78
// --- GIVEN
8-
const dataProtector = new IExecDataProtector();
9+
const dataProtector = new IExecDataProtector(...getTestConfig());
910

1011
// --- WHEN/THEN
1112
await expect(

packages/sdk/tests/test-utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ export const getTestIExecOption = () => ({
3939
});
4040

4141
export const getTestConfig = (
42-
privateKey: string
42+
privateKey?: string
4343
): [Web3SignerProvider, DataProtectorConfigOptions] => {
44-
const ethProvider = getTestWeb3SignerProvider(privateKey);
44+
const ethProvider = privateKey
45+
? getTestWeb3SignerProvider(privateKey)
46+
: undefined;
4547
const options = {
4648
iexecOptions: getTestIExecOption(),
4749
ipfsGateway: process.env.DRONE

0 commit comments

Comments
 (0)