Skip to content

Commit

Permalink
Merge pull request #448 from LIT-Protocol/fix/lit-node-client-nodejs-…
Browse files Browse the repository at this point in the history
…unit-test

fix: Remove invalid test case and adds an exception if no `arguments` are supplied to `LitNodeClient`
  • Loading branch information
Bean authored Apr 30, 2024
2 parents 6154bf4 + 304ed8b commit 1fe907d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ describe('LitNodeClientNodeJs', () => {
expect(isClass(LitNodeClientNodeJs)).toBe(true);
});

it('should be able to instantiate a new LitNodeClientNodeJs', async () => {
const litNodeClient = new LitNodeClientNodeJs();
expect(litNodeClient).toBeDefined();
});

it('should be able to instantiate a new LitNodeClientNodeJs to localhost', async () => {
const litNodeClient = new LitNodeClientNodeJs({
litNetwork: 'localhost',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
logWithRequestId,
mostCommonString,
throwError,
throwErrorV1,
} from '@lit-protocol/misc';
import {
getStorageItem,
Expand Down Expand Up @@ -133,6 +134,14 @@ export class LitNodeClientNodeJs

// ========== Constructor ==========
constructor(args: LitNodeClientConfig | CustomNetwork) {
if (!args) {
throwError({
message: 'must provide LitNodeClient parameters',
errorKind: LIT_ERROR.PARAMS_MISSING_ERROR.kind,
errorCode: LIT_ERROR.PARAMS_MISSING_ERROR.name,
});
}

super(args);

if ('defaultAuthCallback' in args) {
Expand Down

0 comments on commit 1fe907d

Please sign in to comment.