· 4 years ago · Jan 20, 2021, 12:08 PM
1PASS ./config.test.js
2 ● Console
3
4 console.log
5 Jobly Config:
6
7 at Object.<anonymous> (config.js:24:9)
8
9 console.log
10 SECRET_KEY: abc
11
12 at Object.<anonymous> (config.js:25:9)
13
14 console.log
15 PORT: 5000
16
17 at Object.<anonymous> (config.js:26:9)
18
19 console.log
20 BCRYPT_WORK_FACTOR 12
21
22 at Object.<anonymous> (config.js:27:9)
23
24 console.log
25 Database: other
26
27 at Object.<anonymous> (config.js:28:9)
28
29 console.log
30 ---
31
32 at Object.<anonymous> (config.js:29:9)
33
34 PASS helpers/tokens.test.js
35 ● Console
36
37 console.log
38 Jobly Config:
39
40 at Object.<anonymous> (config.js:24:9)
41
42 console.log
43 SECRET_KEY: secret-dev
44
45 at Object.<anonymous> (config.js:25:9)
46
47 console.log
48 PORT: 3001
49
50 at Object.<anonymous> (config.js:26:9)
51
52 console.log
53 BCRYPT_WORK_FACTOR 1
54
55 at Object.<anonymous> (config.js:27:9)
56
57 console.log
58 Database: jobly_test
59
60 at Object.<anonymous> (config.js:28:9)
61
62 console.log
63 ---
64
65 at Object.<anonymous> (config.js:29:9)
66
67 console.assert
68 AssertionError [ERR_ASSERTION]: createToken passed user without isAdmin property
69
70 at createToken (helpers/tokens.js:7:11)
71
72 console.assert
73 AssertionError [ERR_ASSERTION]: createToken passed user without isAdmin property
74
75 at createToken (helpers/tokens.js:7:11)
76
77POST /users 401 49 - 3.066 ms
78POST /users 400 202 - 2.125 ms
79POST /users 400 94 - 1.434 ms
80GET /users 401 49 - 0.795 ms
81GET /users/u1 401 49 - 0.804 ms
82PATCH /users/u1 401 49 - 0.792 ms
83PATCH /users/u1 400 84 - 1.508 ms
84DELETE /users/u1 401 49 - 1.076 ms
85 FAIL routes/users.test.js
86 ● Test suite failed to run
87
88 Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.
89
90 at mapper (../../../../../../usr/local/lib/node_modules/jest/node_modules/jest-jasmine2/build/queueRunner.js:27:45)
91
92POST /auth/token 400 78 - 4.286 ms
93POST /auth/token 400 83 - 1.173 ms
94POST /auth/register 400 202 - 1.393 ms
95POST /auth/register 400 94 - 0.737 ms
96 FAIL routes/auth.test.js
97 ● Test suite failed to run
98
99 Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.
100
101 at mapper (../../../../../../usr/local/lib/node_modules/jest/node_modules/jest-jasmine2/build/queueRunner.js:27:45)
102
103POST /companies 400 119 - 2.510 ms
104POST /companies 400 94 - 1.441 ms
105PATCH /companies/c1 401 49 - 1.102 ms
106PATCH /companies/c1 400 113 - 1.791 ms
107PATCH /companies/c1 400 94 - 1.330 ms
108DELETE /companies/c1 401 49 - 0.455 ms
109 FAIL routes/companies.test.js
110 ● Test suite failed to run
111
112 Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.
113
114 at mapper (../../../../../../usr/local/lib/node_modules/jest/node_modules/jest-jasmine2/build/queueRunner.js:27:45)
115
116 PASS ./app.test.js
117 ● Console
118
119 console.log
120 Jobly Config:
121
122 at Object.<anonymous> (config.js:24:9)
123
124 console.log
125 SECRET_KEY: secret-dev
126
127 at Object.<anonymous> (config.js:25:9)
128
129 console.log
130 PORT: 3001
131
132 at Object.<anonymous> (config.js:26:9)
133
134 console.log
135 BCRYPT_WORK_FACTOR 1
136
137 at Object.<anonymous> (config.js:27:9)
138
139 console.log
140 Database: jobly_test
141
142 at Object.<anonymous> (config.js:28:9)
143
144 console.log
145 ---
146
147 at Object.<anonymous> (config.js:29:9)
148
149 console.error
150 Error: Not Found
151 at /Users/sandraspanikova/coding/Springboard/Node/express-jobly/app.js:31:15
152 at Layer.handle [as handle_request] (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/layer.js:95:5)
153 at trim_prefix (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:317:13)
154 at /Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:284:7
155 at Function.process_params (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:335:12)
156 at next (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:275:10)
157 at authenticateJWT (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/middleware/auth.js:25:12)
158 at Layer.handle [as handle_request] (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/layer.js:95:5)
159 at trim_prefix (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:317:13)
160 at /Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:284:7
161 at Function.process_params (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:335:12)
162 at next (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:275:10)
163 at logger (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/morgan/index.js:144:5)
164 at Layer.handle [as handle_request] (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/layer.js:95:5)
165 at trim_prefix (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:317:13)
166 at /Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:284:7
167 at Function.process_params (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:335:12)
168 at next (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:275:10)
169 at jsonParser (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/body-parser/lib/types/json.js:110:7)
170 at Layer.handle [as handle_request] (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/layer.js:95:5)
171 at trim_prefix (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:317:13)
172 at /Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:284:7
173 at Function.process_params (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:335:12)
174 at next (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:275:10)
175 at cors (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/cors/lib/index.js:188:7)
176 at /Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/cors/lib/index.js:224:17
177 at originCallback (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/cors/lib/index.js:214:15)
178 at /Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/cors/lib/index.js:219:13
179 at optionsCallback (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/cors/lib/index.js:199:9)
180 at corsMiddleware (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/cors/lib/index.js:204:7)
181 at Layer.handle [as handle_request] (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/layer.js:95:5)
182 at trim_prefix (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:317:13)
183 at /Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:284:7
184 at Function.process_params (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:335:12)
185 at next (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:275:10)
186 at expressInit (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/middleware/init.js:40:5)
187 at Layer.handle [as handle_request] (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/layer.js:95:5)
188 at trim_prefix (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:317:13)
189 at /Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:284:7
190 at Function.process_params (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:335:12)
191 at next (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:275:10)
192 at query (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/middleware/query.js:45:5)
193 at Layer.handle [as handle_request] (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/layer.js:95:5)
194 at trim_prefix (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:317:13)
195 at /Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:284:7
196 at Function.process_params (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:335:12)
197 at next (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:275:10)
198 at Function.handle (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/router/index.js:174:3)
199 at Function.handle (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/application.js:174:10)
200 at Server.app (/Users/sandraspanikova/coding/Springboard/Node/express-jobly/node_modules/express/lib/express.js:39:9)
201 at Server.emit (events.js:315:20)
202 at parserOnIncoming (_http_server.js:874:12)
203 at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17)
204
205 34 | /** Generic error handler; anything unhandled goes here. */
206 35 | app.use(function (err, req, res, next) {
207 > 36 | if (process.env.NODE_ENV !== "test") console.error(err.stack);
208 | ^
209 37 | const status = err.status || 500;
210 38 | const message = err.message;
211 39 |
212
213 at app.js:36:48
214 at Layer.handle_error (node_modules/express/lib/router/layer.js:71:5)
215 at trim_prefix (node_modules/express/lib/router/index.js:315:13)
216 at node_modules/express/lib/router/index.js:284:7
217 at Function.process_params (node_modules/express/lib/router/index.js:335:12)
218 at next (node_modules/express/lib/router/index.js:275:10)
219 at app.js:31:10
220 at Layer.handle [as handle_request] (node_modules/express/lib/router/layer.js:95:5)
221
222GET /no-such-path 404 46 - 0.498 ms
223GET /no-such-path 404 46 - 8.710 ms
224 FAIL models/user.test.js
225 ● Test suite failed to run
226
227 Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.
228
229 at mapper (../../../../../../usr/local/lib/node_modules/jest/node_modules/jest-jasmine2/build/queueRunner.js:27:45)
230
231 FAIL models/company.test.js
232 ● Test suite failed to run
233
234 Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.
235
236 at mapper (../../../../../../usr/local/lib/node_modules/jest/node_modules/jest-jasmine2/build/queueRunner.js:27:45)
237
238 PASS middleware/auth.test.js
239 ● Console
240
241 console.log
242 Jobly Config:
243
244 at Object.<anonymous> (config.js:24:9)
245
246 console.log
247 SECRET_KEY: secret-dev
248
249 at Object.<anonymous> (config.js:25:9)
250
251 console.log
252 PORT: 3001
253
254 at Object.<anonymous> (config.js:26:9)
255
256 console.log
257 BCRYPT_WORK_FACTOR 1
258
259 at Object.<anonymous> (config.js:27:9)
260
261 console.log
262 Database: jobly_test
263
264 at Object.<anonymous> (config.js:28:9)
265
266 console.log
267 ---
268
269 at Object.<anonymous> (config.js:29:9)
270
271
272Test Suites: 5 failed, 4 passed, 9 total
273Tests: 11 passed, 11 total
274Snapshots: 0 total
275Time: 967.271 s
276Ran all test suites.
277Jest did not exit one second after the test run has completed.
278
279This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
280