Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronvoell committed Feb 9, 2024
1 parent 7a741f8 commit 7865000
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions example/src/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ test('can make a client', async () => {
})

test('can make a MLS V3 client', async () => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const client = await Client.createRandom({
env: 'local',
appVersion: 'Testing/0.0.0',
Expand Down Expand Up @@ -161,6 +162,7 @@ test('can make a MLS V3 client from bundle', async () => {

test('production MLS V3 client creation throws error', async () => {
try {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const client = await Client.createRandom({
env: 'production',
appVersion: 'Testing/0.0.0',
Expand Down Expand Up @@ -193,7 +195,7 @@ test('can message in a group', async () => {

// Alice's num groups start at 0
let aliceGroups = await aliceClient.conversations.listGroups()
if (aliceGroups.length != 0) {
if (aliceGroups.length !== 0) {
throw new Error('num groups should be 0')
}

Expand All @@ -205,13 +207,13 @@ test('can message in a group', async () => {

// Alice's num groups == 1
aliceGroups = await aliceClient.conversations.listGroups()
if (aliceGroups.length != 1) {
if (aliceGroups.length !== 1) {
throw new Error('num groups should be 1')
}

// Alice can confirm memberAddresses
const memberAddresses = await aliceGroup.memberAddresses()
if (memberAddresses.length != 3) {
if (memberAddresses.length !== 3) {
throw new Error('num group members should be 3')
}
const lowercasedAddresses: string[] = memberAddresses.map((s) =>
Expand All @@ -234,7 +236,7 @@ test('can message in a group', async () => {
// Bob's num groups == 1
await bobClient.conversations.syncGroups()
const bobGroups = await bobClient.conversations.listGroups()
if (bobGroups.length != 1) {
if (bobGroups.length !== 1) {
throw new Error(
'num groups for bob should be 1, but it is' + bobGroups.length
)
Expand All @@ -243,15 +245,15 @@ test('can message in a group', async () => {
// Bob can read messages from Alice
await bobGroups[0].sync()
const bobMessages: DecodedMessage[] = await bobGroups[0].messages()
if (bobMessages.length != 2) {
if (bobMessages.length !== 2) {
throw new Error(
'num messages for bob should be 2, but it is' + bobMessages.length
)
}
if (bobMessages[0].content() != 'gm') {
if (bobMessages[0].content() !== 'gm') {
throw new Error("newest message should be 'gm'")
}
if (bobMessages[1].content() != 'hello, world') {
if (bobMessages[1].content() !== 'hello, world') {
throw new Error("newest message should be 'hello, world'")
}
// Bob can send a message
Expand All @@ -260,7 +262,7 @@ test('can message in a group', async () => {
// Cam's num groups == 1
await camClient.conversations.syncGroups()
const camGroups = await camClient.conversations.listGroups()
if (camGroups.length != 1) {
if (camGroups.length !== 1) {
throw new Error(
'num groups for cam should be 1, but it is' + camGroups.length
)
Expand All @@ -269,10 +271,10 @@ test('can message in a group', async () => {
// Cam can read messages from Alice and Bob
await camGroups[0].sync()
const camMessages = await camGroups[0].messages()
if (camMessages[1].content() != 'gm') {
if (camMessages[1].content() !== 'gm') {
throw new Error("second Message should be 'gm'")
}
if (camMessages[0].content() != 'hey guys!') {
if (camMessages[0].content() !== 'hey guys!') {
throw new Error("newest Message should be 'hey guys!'")
}

Expand Down

0 comments on commit 7865000

Please sign in to comment.