Franck Royer e91f7933c9
Pass proto in constructor
Makes the relation between the protobuf class and the wrapper more
direct. Conversion only happens at creates or on getters.
2021-05-10 16:29:25 +10:00

18 lines
421 B
TypeScript

import { expect } from 'chai';
import { ChatMessage } from 'waku/chat_message';
import { formatMessage } from './chat';
describe('CLI Chat app', () => {
it('Format message', () => {
const date = new Date(234325324);
const chatMessage = ChatMessage.fromUtf8String(
date,
'alice',
'Hello world!'
);
expect(formatMessage(chatMessage)).to.match(/^<.*> alice: Hello world!$/);
});
});