fix(core): update
This commit is contained in:
15
test/test.ts
15
test/test.ts
@ -6,8 +6,13 @@ import { Observable } from 'rxjs';
|
||||
|
||||
let testUniverse: smartuniverse.Universe;
|
||||
let testClientUniverse: smartuniverse.ClientUniverse;
|
||||
let testClientUniverse2: smartuniverse.ClientUniverse;
|
||||
let testClientChannel: smartuniverse.ClientUniverseChannel;
|
||||
|
||||
const testServerData = {
|
||||
serverAddress: 'http://localhost:8765'
|
||||
};
|
||||
|
||||
const testChannelData = {
|
||||
channelName: 'awesomeTestChannel',
|
||||
channelPass: 'awesomeChannelPAss'
|
||||
@ -26,7 +31,7 @@ tap.test('add a message to the SmartUniverse', async () => {
|
||||
// testing message handling
|
||||
tap.test('create smartuniverse client', async () => {
|
||||
testClientUniverse = new smartuniverse.ClientUniverse({
|
||||
serverAddress: 'http://localhost:8765'
|
||||
serverAddress: testServerData.serverAddress
|
||||
});
|
||||
expect(testClientUniverse).to.be.instanceof(smartuniverse.ClientUniverse);
|
||||
});
|
||||
@ -55,6 +60,14 @@ tap.test('universe should contain the sent message', async () => {
|
||||
expect(testUniverse.universeCache.messageMap.getArray()[0].messageText).to.equal('hello');
|
||||
});
|
||||
|
||||
tap.test('a second client should be able to subscibe', async () => {
|
||||
testClientUniverse2 = new smartuniverse.ClientUniverse({
|
||||
serverAddress: testServerData.serverAddress
|
||||
});
|
||||
|
||||
testClientUniverse2.addChannel(testChannelData.channelName, testChannelData.channelPass);
|
||||
});
|
||||
|
||||
tap.test('should receive a message correctly', async () => {});
|
||||
|
||||
tap.test('should disconnect the client correctly', async () => {
|
||||
|
Reference in New Issue
Block a user