Deploy and schema updates for testing
This commit is contained in:
1 parent
8d60aae65c
commit
81b4162117
8 files changed
+389
-86
No files matched your search
@@ -1,6 +1,7 @@
|
||||
const Attachment = require('../../models/Attachment')
|
||||
const User = require('../../models/User')
|
||||
const ScrapeQueue = require('@workers/ScrapeQueue')
|
||||
const Schema = require('@helpers/Schema')
|
||||
const Robots = require('@helpers/Robots')
|
||||
const FetchMock = require('../support/fetchMock')
|
||||
const dns = require('dns').promises
|
||||
@@ -82,6 +83,8 @@ describe('Push URL', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
FetchMock.install()
|
||||
// The server marks this at boot; there is no boot phase in tests.
|
||||
Schema.__setReady(true)
|
||||
Robots.__resetCache()
|
||||
dnsSpy = jest.spyOn(dns, 'lookup').mockResolvedValue([{ address: '93.184.216.34', family: 4 }])
|
||||
// Real code path, no politeness waiting and no robots lookups.
|
||||
@@ -92,6 +95,7 @@ describe('Push URL', () => {
|
||||
FetchMock.restore()
|
||||
dnsSpy.mockRestore()
|
||||
ScrapeQueue.__reset()
|
||||
Schema.__reset()
|
||||
})
|
||||
|
||||
test('scrapes a pushed url into a searchable attachment', () => {
|
||||
|
||||
Reference in new issue
Block a user