Skip to content

Commit

Permalink
build: downgrade ava
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Dec 6, 2023
1 parent 7663b52 commit 8ef40c9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/metascraper-iframe/test/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict'

const CacheableLookup = require('cacheable-lookup')
const { readFile } = require('fs/promises')
const { resolve } = require('path')
const test = require('ava')
Expand All @@ -12,19 +13,20 @@ const createMetascraper = (...args) =>
require('metascraper')([createMetascraperIframe(...args)])

test('provide `gotOpts`', async t => {
const cache = new Map()
console.log('running')
const dnsCache = new CacheableLookup()
const html = await readFile(resolve(__dirname, 'fixtures/genially.html'))
const url = 'https://view.genial.ly/5dc53cfa759d2a0f4c7db5f4'
const metascraper = createMetascraper({ gotOpts: { cache } })
const metascraper = createMetascraper({ gotOpts: { dnsCache } })

const metadataOne = await metascraper({
url,
html,
iframe: { maxWidth: 350 }
})

t.truthy(metadataOne.iframe)
t.is(cache.size, 2)

t.is(dnsCache._cache.size, 2)

const metadataTwo = await metascraper({
url,
Expand All @@ -33,7 +35,7 @@ test('provide `gotOpts`', async t => {
})

t.truthy(metadataTwo.iframe)
t.is(cache.size, 4)
t.is(dnsCache._cache.size, 2)
})

test('provide `iframe`', async t => {
Expand Down

0 comments on commit 8ef40c9

Please sign in to comment.