From 385a0ebcb817b9c0400b03f27df5ae2771f53df5 Mon Sep 17 00:00:00 2001 From: Simonas Karuzas Date: Tue, 11 Feb 2020 16:25:33 +0200 Subject: [PATCH] test: Fixing broken tests --- packages/daf-ethr-did-fs/package.json | 1 + .../daf-ethr-did-fs/src/__tests__/identity-provider.test.ts | 4 ++-- packages/daf-ethr-did-fs/src/didcomm.ts | 2 +- packages/daf-ethr-did-local-storage/package.json | 1 + packages/daf-ethr-did-local-storage/src/didcomm.ts | 2 +- yarn.lock | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/daf-ethr-did-fs/package.json b/packages/daf-ethr-did-fs/package.json index bc0834abd..89f1c950f 100644 --- a/packages/daf-ethr-did-fs/package.json +++ b/packages/daf-ethr-did-fs/package.json @@ -23,6 +23,7 @@ "devDependencies": { "@types/debug": "^4.1.5", "@types/ethjs-signer": "^0.1.0", + "@types/libsodium-wrappers": "^0.7.7", "typescript": "^3.7.2" }, "files": [ diff --git a/packages/daf-ethr-did-fs/src/__tests__/identity-provider.test.ts b/packages/daf-ethr-did-fs/src/__tests__/identity-provider.test.ts index 662847d40..300f55484 100644 --- a/packages/daf-ethr-did-fs/src/__tests__/identity-provider.test.ts +++ b/packages/daf-ethr-did-fs/src/__tests__/identity-provider.test.ts @@ -1,7 +1,7 @@ import SignerProvider from 'ethjs-provider-signer' import { DafResolver } from 'daf-resolver' import { IdentityProvider } from '../identity-provider' -import { EthrIdentity } from '../ethr-identity' +import { Identity } from '../identity' import { createJWT, decodeJWT, verifyJWT } from 'did-jwt' const fs = require('fs') @@ -37,7 +37,7 @@ describe('daf-ethr-did-fs', () => { it('should create identity', async () => { const identity = await identityProvider.createIdentity() - expect(identity).toBeInstanceOf(EthrIdentity) + expect(identity).toBeInstanceOf(Identity) }) it('identity signs jwt', async () => { diff --git a/packages/daf-ethr-did-fs/src/didcomm.ts b/packages/daf-ethr-did-fs/src/didcomm.ts index 980767fd6..46060a42c 100644 --- a/packages/daf-ethr-did-fs/src/didcomm.ts +++ b/packages/daf-ethr-did-fs/src/didcomm.ts @@ -1,5 +1,5 @@ const Base58 = require('base-58') -import sodium from 'libsodium-wrappers' +import * as sodium from 'libsodium-wrappers' interface IUnpackedMsg { message: string diff --git a/packages/daf-ethr-did-local-storage/package.json b/packages/daf-ethr-did-local-storage/package.json index 0153bcfaf..0bb7183e6 100644 --- a/packages/daf-ethr-did-local-storage/package.json +++ b/packages/daf-ethr-did-local-storage/package.json @@ -22,6 +22,7 @@ }, "devDependencies": { "@types/debug": "^4.1.5", + "@types/libsodium-wrappers": "^0.7.7", "typescript": "^3.7.2" }, "files": [ diff --git a/packages/daf-ethr-did-local-storage/src/didcomm.ts b/packages/daf-ethr-did-local-storage/src/didcomm.ts index 980767fd6..46060a42c 100644 --- a/packages/daf-ethr-did-local-storage/src/didcomm.ts +++ b/packages/daf-ethr-did-local-storage/src/didcomm.ts @@ -1,5 +1,5 @@ const Base58 = require('base-58') -import sodium from 'libsodium-wrappers' +import * as sodium from 'libsodium-wrappers' interface IUnpackedMsg { message: string diff --git a/yarn.lock b/yarn.lock index fc04ae9b8..fb3af1e7c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2710,7 +2710,7 @@ "@types/koa-compose" "*" "@types/node" "*" -"@types/libsodium-wrappers@^0.7.5": +"@types/libsodium-wrappers@^0.7.5", "@types/libsodium-wrappers@^0.7.7": version "0.7.7" resolved "https://registry.yarnpkg.com/@types/libsodium-wrappers/-/libsodium-wrappers-0.7.7.tgz#cdb25e85458612ec80f0157c3815fac187d0b6d2" integrity sha512-Li91pVKcLvQJK3ZolwCPo85oxf2gKBCApgnesRxYg4OVYchLXcJB2eivX8S87vfQVv6ZRnyCO1lLDosZGJfpRg==