Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LiranCohen committed Feb 23, 2024
1 parent 1c9adee commit d699035
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/dwn-server.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { Dwn } from '@tbd54566975/dwn-sdk-js';

import { expect } from 'chai';

import { config } from '../src/config.js';
Expand All @@ -6,12 +8,12 @@ import { getTestDwn } from './test-dwn.js';

describe('DwnServer', function () {
const dwnServerConfig = { ...config };
let dwn: Dwn;


it('starts with injected dwn', async function () {
const testDwn = await getTestDwn();
dwn = await getTestDwn();

const dwnServer = new DwnServer({ config: dwnServerConfig, dwn: testDwn });
const dwnServer = new DwnServer({ config: dwnServerConfig, dwn });
await dwnServer.start();

dwnServer.stop(() => console.log('server Stop'));
Expand All @@ -20,7 +22,9 @@ describe('DwnServer', function () {

describe('webSocketServerEnabled config', function() {
it('should not return a websocket server if disabled', async function() {
dwn = await getTestDwn({ withEvents: true });
const withoutSocketServer = new DwnServer({
dwn,
config: {
...dwnServerConfig,
webSocketServerEnabled: false,
Expand All @@ -35,7 +39,9 @@ describe('DwnServer', function () {
});

it('should return a websocket server if enabled', async function() {
dwn = await getTestDwn({ withEvents: true });
const withSocketServer = new DwnServer({
dwn,
config: {
...dwnServerConfig,
webSocketServerEnabled: true,
Expand Down

0 comments on commit d699035

Please sign in to comment.