Add some nocks for failing URL tests
This commit is contained in:
committed by
Hongbo Wu
parent
fc2e4f7d8c
commit
4966af354a
@ -5,6 +5,7 @@ import { createTestUser, deleteTestUser } from '../db'
|
||||
import { SaveContext, saveEmail } from '../../src/services/save_email'
|
||||
import { createPubSubClient } from '../../src/datalayer/pubsub'
|
||||
import { getPageByParam } from '../../src/elastic/pages'
|
||||
import nock from 'nock/types'
|
||||
|
||||
describe('saveEmail', () => {
|
||||
const username = 'fakeUser'
|
||||
@ -15,6 +16,8 @@ describe('saveEmail', () => {
|
||||
})
|
||||
|
||||
it('doesnt fail if saved twice', async () => {
|
||||
nock('https://blog.omnivore.app').get('/fake-url').reply(404)
|
||||
|
||||
const url = 'https://blog.omnivore.app/fake-url'
|
||||
const title = 'fake title'
|
||||
const author = 'fake author'
|
||||
|
||||
@ -9,6 +9,7 @@ import { NewsletterEmail } from '../../src/entity/newsletter_email'
|
||||
import { SaveContext } from '../../src/services/save_email'
|
||||
import { createPubSubClient } from '../../src/datalayer/pubsub'
|
||||
import { getPageByParam } from '../../src/elastic/pages'
|
||||
import nock from 'nock/types'
|
||||
|
||||
describe('saveNewsletterEmail', () => {
|
||||
const username = 'fakeUser'
|
||||
@ -35,6 +36,7 @@ describe('saveNewsletterEmail', () => {
|
||||
})
|
||||
|
||||
it('adds the newsletter to the library', async () => {
|
||||
nock('https://blog.omnivore.app').get('/fake-url').reply(404)
|
||||
const url = 'https://blog.omnivore.app/fake-url'
|
||||
|
||||
await saveNewsletterEmail(
|
||||
|
||||
Reference in New Issue
Block a user