forked from nodejs/node-core-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreviews.test.js
More file actions
37 lines (31 loc) · 977 Bytes
/
Copy pathreviews.test.js
File metadata and controls
37 lines (31 loc) · 977 Bytes
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
import { describe, it } from 'node:test';
import assert from 'node:assert';
import { ReviewAnalyzer } from '../../lib/reviews.js';
import {
allGreenReviewers,
requestedChangesReviewers,
approvingReviews,
requestingChangesReviews,
commentsWithLGTM,
collaborators
} from '../fixtures/data.js';
describe('ReviewAnalyzer', () => {
it('should parse reviews and comments that all approve', () => {
const analyzer = new ReviewAnalyzer({
reviews: approvingReviews,
comments: commentsWithLGTM,
collaborators
});
const reviewers = analyzer.getReviewers();
assert.deepStrictEqual(reviewers, allGreenReviewers);
});
it('should parse reviews and comments that rejects', () => {
const analyzer = new ReviewAnalyzer({
reviews: requestingChangesReviews,
comments: [],
collaborators
});
const reviewers = analyzer.getReviewers();
assert.deepStrictEqual(reviewers, requestedChangesReviewers);
});
});