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) · 953 Bytes
/
reviews.test.js
File metadata and controls
37 lines (31 loc) · 953 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
'use strict';
const assert = require('assert');
const { ReviewAnalyzer } = require('../../lib/reviews');
const {
allGreenReviewers,
requestedChangesReviewers,
approvingReviews,
requestingChangesReviews,
commentsWithLGTM,
collaborators
} = require('../fixtures/data');
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);
});
});