-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.test.ts
41 lines (38 loc) · 1.13 KB
/
index.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { describe, expect, test, jest, beforeEach, } from '@jest/globals';
import tp2json from './index.js';
import { Config } from './types/config.js';
describe('tp2json', () => {
test('pull 10 reviews', async () => {
const reviewCount = 10
const config: Config = {
country: 'uk',
profile: 'www.monzo.com',
limit: reviewCount
}
const reviews = await tp2json(config)
await new Promise(process.nextTick);
expect(reviews.length).toBe(reviewCount)
}, 30 * 1000);
test('pull 50 reviews', async () => {
const reviewCount = 50
const config: Config = {
country: 'uk',
profile: 'starlingbank.com',
limit: reviewCount
}
const reviews = await tp2json(config)
await new Promise(process.nextTick);
expect(reviews.length).toBe(reviewCount)
}, 30 * 1000);
test('pull 100 reviews', async () => {
const reviewCount = 100
const config: Config = {
country: 'uk',
profile: 'tide.co',
limit: reviewCount
}
const reviews = await tp2json(config)
await new Promise(process.nextTick);
expect(reviews.length).toBe(reviewCount)
}, 30 * 1000);
});