fix tests

This commit is contained in:
Hongbo Wu 2022-07-07 17:38:14 +08:00
parent ef0c2434fb
commit 7b714e7bc3

View file

@ -8,7 +8,7 @@ import { SubstackHandler } from '../src/substack-handler'
import { AxiosHandler } from '../src/axios-handler'
import { BloombergHandler } from '../src/bloomberg-handler'
import { GolangHandler } from '../src/golang-handler'
import { getNewsletterHandler } from '../src'
import { getNewsletterHandler, parseUnsubscribe } from '../src'
import { MorningBrewHandler } from '../src/morning-brew-handler'
describe('Confirmation email test', () => {
@ -158,17 +158,13 @@ describe('Newsletter email test', () => {
it('returns mail to address if exists', () => {
const header = `<https://omnivore.com/unsub>, <mailto:${mailTo}>`
expect(new NewsletterHandler().parseUnsubscribe(header).mailTo).to.equal(
mailTo
)
expect(parseUnsubscribe(header).mailTo).to.equal(mailTo)
})
it('returns http url if exists', () => {
const header = `<${httpUrl}>`
expect(new NewsletterHandler().parseUnsubscribe(header).httpUrl).to.equal(
httpUrl
)
expect(parseUnsubscribe(header).httpUrl).to.equal(httpUrl)
})
})
})