This commit is contained in:
Adhiraj
2020-08-30 23:22:04 +05:30
parent 29f547ed8d
commit 61104e8a6b
4 changed files with 16 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
import { Presence, ChatModification, delay } from '../WAConnection/WAConnection'
import {promises as fs} from 'fs'
import { promises as fs } from 'fs'
import * as assert from 'assert'
import fetch from 'node-fetch'
import { WAConnectionTest, testJid } from './Common'
@@ -134,4 +134,11 @@ WAConnectionTest('Misc', (conn) => {
await delay(1500)
}
})
it('should generate link previews correctly', async () => {
await conn.generateLinkPreview ('hello this is from https://www.github.com/adiwajshing/Baileys')
// two links should fail
await assert.rejects (
conn.generateLinkPreview ('I sent links to https://teachyourselfcs.com/ and https://www.fast.ai/')
)
})
})