Skip to content

Commit

Permalink
Chores (typos, unused imports, etc.) and revert Web5 User Agent test …
Browse files Browse the repository at this point in the history
…endpoints

Signed-off-by: Frank Hinek <[email protected]>
  • Loading branch information
frankhinek committed May 17, 2023
1 parent 1ceea37 commit 561f475
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/dids/tests/did-key.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DidKeyApi } from '../src/did-key.js';
const DidKey = new DidKeyApi();

describe('DidKeyApi', () => {
it.only('works', async () => {
it('works', async () => {
const didState = await DidKey.create();

expect(didState.id).to.exist;
Expand Down
19 changes: 8 additions & 11 deletions packages/web5-user-agent/tests/common/web5-user-agent.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { expect } from 'chai';
import { Encoder, RecordsWriteMessage, RecordsRead } from '@tbd54566975/dwn-sdk-js';
import { TestAgent } from './utils/test-user-agent.js';

let testAgent: TestAgent;
let did: string;
let dwnNodes: string[] = ['https://dwn.tbddev.org/dwn0'];
// let dwnNodes: string[] = ['http://localhost:3000'];
let testAgent: TestAgent;

describe('Web5UserAgent', () => {
before(async () => {
Expand Down Expand Up @@ -47,8 +49,7 @@ describe('Web5UserAgent', () => {
type : 'dwn',
id : 'dwn',
serviceEndpoint : {
// nodes: ['https://dwn.tbddev.org/dwn0']
nodes: ['http://localhost:3000']
nodes: dwnNodes
}
}]
}
Expand Down Expand Up @@ -80,8 +81,7 @@ describe('Web5UserAgent', () => {
type : 'dwn',
id : 'dwn',
serviceEndpoint : {
// nodes: ['https://dwn.tbddev.org/dwn0']
nodes: ['http://localhost:3000']
nodes: dwnNodes
}
}]
}
Expand All @@ -101,22 +101,20 @@ describe('Web5UserAgent', () => {
expect(response.reply.status.code).to.equal(404);
});

it('returns something when an jwark is smorked', async () => {
it('throws an error when DwnRequest fails validation', async () => {
const { did: aliceDid } = await testAgent.createProfile({
profileDidOptions: {
services: [{
type : 'dwn',
id : 'dwn',
serviceEndpoint : {
// nodes: ['https://dwn.tbddev.org/dwn0']
nodes: ['http://localhost:3000']
nodes: dwnNodes
}
}]
}
});

try {
// TODO: (Moe -> Frank): what should sendDwnRequest return and how does it propogate back up to the caller?
await testAgent.agent.sendDwnRequest({
author : aliceDid,
target : aliceDid,
Expand All @@ -138,8 +136,7 @@ describe('Web5UserAgent', () => {
type : 'dwn',
id : 'dwn',
serviceEndpoint : {
// nodes: ['https://dwn.tbddev.org/dwn0']
nodes: ['http://localhost:3000']
nodes: dwnNodes
}
}]
}
Expand Down
2 changes: 1 addition & 1 deletion packages/web5/src/dwn-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { DwnInterfaceName, DwnMethodName } from '@tbd54566975/dwn-sdk-js';

import { Record } from './record.js';
import { Protocol } from './protocol.js';
import { dataToBlob, isDataSizeUnderCacheLimit, isEmptyObject } from './utils.js';
import { dataToBlob, isEmptyObject } from './utils.js';

// TODO: Export type ProtocolsConfigureDescriptor from dwn-sdk-js.
export type ProtocolsConfigureDescriptor = {
Expand Down
2 changes: 1 addition & 1 deletion packages/web5/tests/web5-dwn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('web5.dwn', () => {
});

describe('from: did', () => {
xit('test neeed');
xit('test needed');
});
});

Expand Down

0 comments on commit 561f475

Please sign in to comment.