@@ -5,7 +5,6 @@ const url = require('url')
5
5
const nock = require ( 'nock' )
6
6
const supertest = require ( 'supertest' )
7
7
const proxyquire = require ( 'proxyquire' )
8
- const lolex = require ( 'lolex' )
9
8
10
9
const testStubs = {
11
10
'./github-secret' : {
@@ -24,7 +23,6 @@ const readFixture = require('../read-fixture')
24
23
setupNoRequestMatchHandler ( )
25
24
26
25
tap . test ( 'Sends POST request to https://api.github.com/repos/nodejs/node/issues/<PR-NUMBER>/labels' , ( t ) => {
27
- const clock = lolex . install ( )
28
26
const expectedLabels = [ 'timers' ]
29
27
const webhookPayload = readFixture ( 'pull-request-opened.json' )
30
28
@@ -48,7 +46,6 @@ tap.test('Sends POST request to https://api.github.com/repos/nodejs/node/issues/
48
46
filesScope . done ( )
49
47
existingRepoLabelsScope . done ( )
50
48
newLabelsScope . done ( )
51
- clock . uninstall ( )
52
49
} )
53
50
54
51
supertest ( app )
@@ -57,13 +54,11 @@ tap.test('Sends POST request to https://api.github.com/repos/nodejs/node/issues/
57
54
. send ( webhookPayload )
58
55
. expect ( 200 )
59
56
. end ( ( err , res ) => {
60
- clock . runAll ( )
61
57
t . equal ( err , null )
62
58
} )
63
59
} )
64
60
65
61
tap . test ( 'Adds v6.x label when PR is targeting the v6.x-staging branch' , ( t ) => {
66
- const clock = lolex . install ( )
67
62
const expectedLabels = [ 'timers' , 'v6.x' ]
68
63
const webhookPayload = readFixture ( 'pull-request-opened-v6.x.json' )
69
64
@@ -87,7 +82,6 @@ tap.test('Adds v6.x label when PR is targeting the v6.x-staging branch', (t) =>
87
82
filesScope . done ( )
88
83
existingRepoLabelsScope . done ( )
89
84
newLabelsScope . done ( )
90
- clock . uninstall ( )
91
85
} )
92
86
93
87
supertest ( app )
@@ -96,14 +90,12 @@ tap.test('Adds v6.x label when PR is targeting the v6.x-staging branch', (t) =>
96
90
. send ( webhookPayload )
97
91
. expect ( 200 )
98
92
. end ( ( err , res ) => {
99
- clock . runAll ( )
100
93
t . equal ( err , null )
101
94
} )
102
95
} )
103
96
104
97
// reported bug: https://github.com/nodejs/github-bot/issues/58
105
98
tap . test ( 'Does not create labels which does not already exist' , ( t ) => {
106
- const clock = lolex . install ( )
107
99
const webhookPayload = readFixture ( 'pull-request-opened-mapproxy.json' )
108
100
109
101
const filesScope = nock ( 'https://api.github.com' )
@@ -120,7 +112,6 @@ tap.test('Does not create labels which does not already exist', (t) => {
120
112
t . tearDown ( ( ) => {
121
113
filesScope . done ( )
122
114
existingRepoLabelsScope . done ( )
123
- clock . uninstall ( )
124
115
} )
125
116
126
117
supertest ( app )
@@ -129,14 +120,12 @@ tap.test('Does not create labels which does not already exist', (t) => {
129
120
. send ( webhookPayload )
130
121
. expect ( 200 )
131
122
. end ( ( err , res ) => {
132
- clock . runAll ( )
133
123
t . equal ( err , null )
134
124
} )
135
125
} )
136
126
137
127
// reported bug: https://github.com/nodejs/github-bot/issues/92
138
128
tap . test ( 'Adds V8 Engine label when PR has deps/v8 file changes' , ( t ) => {
139
- const clock = lolex . install ( )
140
129
const expectedLabels = [ 'V8 Engine' ]
141
130
const webhookPayload = readFixture ( 'pull-request-opened-v8.json' )
142
131
@@ -160,7 +149,6 @@ tap.test('Adds V8 Engine label when PR has deps/v8 file changes', (t) => {
160
149
filesScope . done ( )
161
150
existingRepoLabelsScope . done ( )
162
151
newLabelsScope . done ( )
163
- clock . uninstall ( )
164
152
} )
165
153
166
154
supertest ( app )
@@ -169,7 +157,6 @@ tap.test('Adds V8 Engine label when PR has deps/v8 file changes', (t) => {
169
157
. send ( webhookPayload )
170
158
. expect ( 200 )
171
159
. end ( ( err , res ) => {
172
- clock . runAll ( )
173
160
t . equal ( err , null )
174
161
} )
175
162
} )
0 commit comments