mirror of
https://github.com/ZFC-Digital/cf-clearance-scraper.git
synced 2025-08-31 09:00:46 +00:00
28 lines
772 B
JavaScript
28 lines
772 B
JavaScript
process.env.NODE_ENV = 'development'
|
|
process.env.SKIP_LAUNCH = "true"
|
|
process.env.authToken = "123456"
|
|
process.env.browserLimit = -1
|
|
|
|
const server = require('../src/index')
|
|
const request = require("supertest")
|
|
|
|
test('Request Authorisation Control Test', async () => {
|
|
return request(server)
|
|
.post("/cf-clearance-scraper")
|
|
.send({
|
|
url: 'https://nopecha.com/demo/cloudflare',
|
|
mode: "source"
|
|
})
|
|
.expect(401)
|
|
}, 10000)
|
|
|
|
test('Browser Context Limit Control Test', async () => {
|
|
return request(server)
|
|
.post("/cf-clearance-scraper")
|
|
.send({
|
|
url: 'https://nopecha.com/demo/cloudflare',
|
|
mode: "source",
|
|
authToken: "123456"
|
|
})
|
|
.expect(429)
|
|
}, 10000) |