Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import MockServer from 'mock-http-server'
import Crawler from '../src'
const server = new MockServer({ host: 'localhost', port: 9000 }, null)
const createPage = (id: string) => {
server.on({
method: 'GET',
path: `/${id}`,
reply: {
status: 200,
headers: { 'content-type': 'text/html' },
body: `<div id="node">${id}</div>`
}
})
return `http://localhost:9000/${id}`
}
beforeEach(done => {
server.start(done)