· 7 years ago · Feb 20, 2019, 10:02 PM
1$ npm test
2
3> bloccit@1.0.0 test C:\Users\tanya\bloc\bloccit
4> set NODE_ENV=test&& jasmine
5
6Started
7server is listening for requests on port 3000
8Welcome to Bloccit
9About Us
10....Topic {
11 dataValues:
12 { id: 2,
13 title: 'blink-182 songs',
14 description: 'What\'s your favorite blink-182 song?',
15 createdAt: 2019-02-18T16:13:44.481Z,
16 updatedAt: 2019-02-18T16:13:44.481Z },
17 _previousDataValues:
18 { id: 2,
19 title: 'blink-182 songs',
20 description: 'What\'s your favorite blink-182 song?',
21 createdAt: 2019-02-18T16:13:44.481Z,
22 updatedAt: 2019-02-18T16:13:44.481Z },
23 _changed: {},
24 _modelOptions:
25 { timestamps: true,
26 validate: {},
27 freezeTableName: false,
28 underscored: false,
29 underscoredAll: false,
30 paranoid: false,
31 rejectOnEmpty: false,
32 whereCollection: { title: 'blink-182 songs' },
33 schema: null,
34 schemaDelimiter: '',
35 defaultScope: {},
36 scopes: [],
37 indexes: [],
38 name: { plural: 'Topics', singular: 'Topic' },
39 omitNull: false,
40 sequelize:
41 Sequelize {
42 options: [Object],
43 config: [Object],
44 dialect: [PostgresDialect],
45 queryInterface: [QueryInterface],
46 models: [Object],
47 modelManager: [ModelManager],
48 connectionManager: [ConnectionManager],
49 importCache: [Object],
50 test: [Object] },
51 hooks: {},
52 uniqueKeys: {} },
53 _options:
54 { isNewRecord: false,
55 _schema: null,
56 _schemaDelimiter: '',
57 raw: true,
58 attributes: [ 'id', 'title', 'description', 'createdAt', 'updatedAt' ] },
59 __eagerlyLoadedAssociations: [],
60 isNewRecord: false }
61...FF{ SequelizeDatabaseError: relation "Topics" does not exist
62 at Query.formatError (C:\Users\tanya\bloc\bloccit\node_modules\sequelize\lib\dialects\postgres\query.js:363:16)
63 at query.catch.err (C:\Users\tanya\bloc\bloccit\node_modules\sequelize\lib\dialects\postgres\query.js:86:18)
64 at tryCatcher (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\util.js:16:23)
65 at Promise._settlePromiseFromHandler (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:512:31)
66 at Promise._settlePromise (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:569:18)
67 at Promise._settlePromise0 (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:614:10)
68 at Promise._settlePromises (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:690:18)
69 at _drainQueueStep (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:138:12)
70 at _drainQueue (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:131:9)
71 at Async._drainQueues (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:147:5)
72 at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:17:14)
73 at runCallback (timers.js:705:18)
74 at tryOnImmediate (timers.js:676:5)
75 at processImmediate (timers.js:658:5)
76 name: 'SequelizeDatabaseError',
77 parent:
78 { error: relation "Topics" does not exist
79 at Connection.parseE (C:\Users\tanya\bloc\bloccit\node_modules\pg\lib\connection.js:545:11)
80 at Connection.parseMessage (C:\Users\tanya\bloc\bloccit\node_modules\pg\lib\connection.js:370:19)
81 at Socket.<anonymous> (C:\Users\tanya\bloc\bloccit\node_modules\pg\lib\connection.js:113:22)
82 at Socket.emit (events.js:182:13)
83 at addChunk (_stream_readable.js:283:12)
84 at readableAddChunk (_stream_readable.js:264:11)
85 at Socket.Readable.push (_stream_readable.js:219:10)
86 at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
87 name: 'error',
88 length: 105,
89 severity: 'ERROR',
90 code: '42P01',
91 detail: undefined,
92 hint: undefined,
93 position: '13',
94 internalPosition: undefined,
95 internalQuery: undefined,
96 where: undefined,
97 schema: undefined,
98 table: undefined,
99 column: undefined,
100 dataType: undefined,
101 constraint: undefined,
102 file: 'parse_relation.c',
103 line: '1180',
104 routine: 'parserOpenTable',
105 sql:
106 'INSERT INTO "Topics" ("id","title","description","createdAt","updatedAt") VALUES (DEFAULT,\'JSFrameworks\',\'There is a lot of them\',\'2019-02-18 16:13:45.001 +00:00\',\'2019-02-18 16:13:45.001 +00:00\') RETURNING *;' },
107 original:
108 { error: relation "Topics" does not exist
109 at Connection.parseE (C:\Users\tanya\bloc\bloccit\node_modules\pg\lib\connection.js:545:11)
110 at Connection.parseMessage (C:\Users\tanya\bloc\bloccit\node_modules\pg\lib\connection.js:370:19)
111 at Socket.<anonymous> (C:\Users\tanya\bloc\bloccit\node_modules\pg\lib\connection.js:113:22)
112 at Socket.emit (events.js:182:13)
113 at addChunk (_stream_readable.js:283:12)
114 at readableAddChunk (_stream_readable.js:264:11)
115 at Socket.Readable.push (_stream_readable.js:219:10)
116 at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
117 name: 'error',
118 length: 105,
119 severity: 'ERROR',
120 code: '42P01',
121 detail: undefined,
122 hint: undefined,
123 position: '13',
124 internalPosition: undefined,
125 internalQuery: undefined,
126 where: undefined,
127 schema: undefined,
128 table: undefined,
129 column: undefined,
130 dataType: undefined,
131 constraint: undefined,
132 file: 'parse_relation.c',
133 line: '1180',
134 routine: 'parserOpenTable',
135 sql:
136 'INSERT INTO "Topics" ("id","title","description","createdAt","updatedAt") VALUES (DEFAULT,\'JSFrameworks\',\'There is a lot of them\',\'2019-02-18 16:13:45.001 +00:00\',\'2019-02-18 16:13:45.001 +00:00\') RETURNING *;' },
137 sql:
138 'INSERT INTO "Topics" ("id","title","description","createdAt","updatedAt") VALUES (DEFAULT,\'JS Frameworks\',\'There is a lot of them\',\'2019-02-18 16:13:45.001 +00:00\',\'2019-02-18 16:13:45.001 +00:00\') RETURNING *;' }
139F...
140
141Failures:
1421) routes : topics POST /topics/:id/destroy should delete the topic with the associated ID
143 Message:
144 Expected 'Not Found. Redirecting to /' to contain 'JS Frameworks'.
145 Stack:
146 Error: Expected 'Not Found. Redirecting to /' to contain 'JS Frameworks'.
147 at <Jasmine>
148 at Request.request.get [as _callback] (C:\Users\tanya\bloc\bloccit\spec\integration\topics_spec.js:118:22)
149 at Request.self.callback (C:\Users\tanya\bloc\bloccit\node_modules\request\request.js:186:22)
150 at Request.emit (events.js:182:13)
151 at Request.<anonymous> (C:\Users\tanya\bloc\bloccit\node_modules\request\request.js:1163:10)
152 at Request.emit (events.js:182:13)
153 at IncomingMessage.<anonymous> (C:\Users\tanya\bloc\bloccit\node_modules\request\request.js:1085:12)
154 at Object.onceWrapper (events.js:273:13)
155 at IncomingMessage.emit (events.js:187:15)
156 at endReadableNT (_stream_readable.js:1094:12)
157 at process._tickCallback (internal/process/next_tick.js:63:19)
158 Message:
159 ReferenceError: done is not defined
160 Stack:
161 at <Jasmine>
162 at Request.request.get [as _callback] (C:\Users\tanya\bloc\bloccit\spec\integration\topics_spec.js:119:9)
163 at Request.self.callback (C:\Users\tanya\bloc\bloccit\node_modules\request\request.js:186:22)
164 at Request.emit (events.js:182:13)
165 at Request.<anonymous> (C:\Users\tanya\bloc\bloccit\node_modules\request\request.js:1163:10)
166 at Request.emit (events.js:182:13)
167 at IncomingMessage.<anonymous> (C:\Users\tanya\bloc\bloccit\node_modules\request\request.js:1085:12)
168 at Object.onceWrapper (events.js:273:13)
169 at IncomingMessage.emit (events.js:187:15)
170 at endReadableNT (_stream_readable.js:1094:12)
171 at process._tickCallback (internal/process/next_tick.js:63:19)
172 Message:
173 Failed: done is not defined
174 Stack:
175 at <Jasmine>
176 at Request.request.get [as _callback] (C:\Users\tanya\bloc\bloccit\spec\integration\topics_spec.js:119:9)
177 at Request.self.callback (C:\Users\tanya\bloc\bloccit\node_modules\request\request.js:186:22)
178 at Request.emit (events.js:182:13)
179 at Request.<anonymous> (C:\Users\tanya\bloc\bloccit\node_modules\request\request.js:1163:10)
180 at Request.emit (events.js:182:13)
181 at IncomingMessage.<anonymous> (C:\Users\tanya\bloc\bloccit\node_modules\request\request.js:1085:12)
182 at Object.onceWrapper (events.js:273:13)
183 at IncomingMessage.emit (events.js:187:15)
184 at endReadableNT (_stream_readable.js:1094:12)
185 at process._tickCallback (internal/process/next_tick.js:63:19)
186 Message:
187 TypeError: Cannot read property 'id' of undefined
188 Stack:
189 at <Jasmine>
190 at topicQueries.deleteTopic (C:\Users\tanya\bloc\bloccit\src\controllers\topicController.js:42:44)
191 at Topic.destroy.then.catch (C:\Users\tanya\bloc\bloccit\src\db\queries.topics.js:50:7)
192 at tryCatcher (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\util.js:16:23)
193 at Promise._settlePromiseFromHandler (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:512:31)
194 at Promise._settlePromise (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:569:18)
195 at Promise._settlePromise0 (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:614:10)
196 at Promise._settlePromises (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:690:18)
197 at _drainQueueStep (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:138:12)
198 at _drainQueue (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:131:9)
199 at Async._drainQueues (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:147:5)
200 at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:17:14)
201 at runCallback (timers.js:705:18)
202 at tryOnImmediate (timers.js:676:5)
203 at processImmediate (timers.js:658:5)
204 Message:
205 Failed: Cannot read property 'id' of undefined
206 Stack:
207 at <Jasmine>
208 at topicQueries.deleteTopic (C:\Users\tanya\bloc\bloccit\src\controllers\topicController.js:42:44)
209 at Topic.destroy.then.catch (C:\Users\tanya\bloc\bloccit\src\db\queries.topics.js:50:7)
210 at tryCatcher (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\util.js:16:23)
211 at Promise._settlePromiseFromHandler (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:512:31)
212 at Promise._settlePromise (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:569:18)
213 at Promise._settlePromise0 (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:614:10)
214 at Promise._settlePromises (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:690:18)
215 at _drainQueueStep (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:138:12)
216 at _drainQueue (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:131:9)
217 at Async._drainQueues (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:147:5)
218 at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:17:14)
219 at runCallback (timers.js:705:18)
220 at tryOnImmediate (timers.js:676:5)
221 at processImmediate (timers.js:658:5)
222
2232) routes : topics GET /topics/:id/edit should render a view with an edit topic form
224 Message:
225 SequelizeUniqueConstraintError: Validation error
226 Stack:
227 error properties: Object({ errors: [ ValidationErrorItem({ message: 'typname must be unique', type: 'unique violation', path: 'typname', value: 'Banners_id_seq', origin: 'DB', instance: null, validatorKey: 'not_unique', validatorName: null, validatorArgs: [ ] }), ValidationErrorItem({ message: 'typnamespace must be unique', type: 'unique violation', path: 'typnamespace', value: '2200', origin: 'DB',instance: null, validatorKey: 'not_unique', validatorName: null, validatorArgs: [ ] }) ], fields: Object({ typname: 'Banners_id_seq', typnamespace: '2200' }), parent: error: duplicate key value violatesunique constraint "pg_type_typname_nsp_index", original: error: duplicate key value violates unique constraint "pg_type_typname_nsp_index", sql: 'CREATE TABLE IF NOT EXISTS "Banners" ("id" SERIAL , "source" VARCHAR(255), "description" VARCHAR(255), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "topicId" INTEGER REFERENCES "Topics" ("id") ON DELETE CASCAD ...
228 at <Jasmine>
229 at Query.formatError (C:\Users\tanya\bloc\bloccit\node_modules\sequelize\lib\dialects\postgres\query.js:325:18)
230 at query.catch.err (C:\Users\tanya\bloc\bloccit\node_modules\sequelize\lib\dialects\postgres\query.js:86:18)
231 at tryCatcher (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\util.js:16:23)
232 at Promise._settlePromiseFromHandler (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:512:31)
233 at Promise._settlePromise (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:569:18)
234 at Promise._settlePromise0 (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:614:10)
235 at Promise._settlePromises (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:690:18)
236 at _drainQueueStep (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:138:12)
237 at _drainQueue (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:131:9)
238 at Async._drainQueues (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:147:5)
239 at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:17:14)
240 at runCallback (timers.js:705:18)
241 at tryOnImmediate (timers.js:676:5)
242 at processImmediate (timers.js:658:5)
243 Message:
244 Failed: Validation error
245 Stack:
246 error properties: Object({ errors: [ ValidationErrorItem({ message: 'typname must be unique', type: 'unique violation', path: 'typname', value: 'Banners_id_seq', origin: 'DB', instance: null, validatorKey: 'not_unique', validatorName: null, validatorArgs: [ ] }), ValidationErrorItem({ message: 'typnamespace must be unique', type: 'unique violation', path: 'typnamespace', value: '2200', origin: 'DB',instance: null, validatorKey: 'not_unique', validatorName: null, validatorArgs: [ ] }) ], fields: Object({ typname: 'Banners_id_seq', typnamespace: '2200' }), parent: error: duplicate key value violatesunique constraint "pg_type_typname_nsp_index", original: error: duplicate key value violates unique constraint "pg_type_typname_nsp_index", sql: 'CREATE TABLE IF NOT EXISTS "Banners" ("id" SERIAL , "source" VARCHAR(255), "description" VARCHAR(255), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "topicId" INTEGER REFERENCES "Topics" ("id") ON DELETE CASCAD ...
247 at <Jasmine>
248 at Query.formatError (C:\Users\tanya\bloc\bloccit\node_modules\sequelize\lib\dialects\postgres\query.js:325:18)
249 at query.catch.err (C:\Users\tanya\bloc\bloccit\node_modules\sequelize\lib\dialects\postgres\query.js:86:18)
250 at tryCatcher (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\util.js:16:23)
251 at Promise._settlePromiseFromHandler (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:512:31)
252 at Promise._settlePromise (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:569:18)
253 at Promise._settlePromise0 (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:614:10)
254 at Promise._settlePromises (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:690:18)
255 at _drainQueueStep (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:138:12)
256 at _drainQueue (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:131:9)
257 at Async._drainQueues (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:147:5)
258 at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:17:14)
259 at runCallback (timers.js:705:18)
260 at tryOnImmediate (timers.js:676:5)
261 at processImmediate (timers.js:658:5)
262 Message:
263 Expected 'Not Found. Redirecting to /' to contain 'Edit Topic'.
264 Stack:
265 Error: Expected 'Not Found. Redirecting to /' to contain 'Edit Topic'.
266 at <Jasmine>
267 at Request.request.get [as _callback] (C:\Users\tanya\bloc\bloccit\spec\integration\topics_spec.js:156:22)
268 at Request.self.callback (C:\Users\tanya\bloc\bloccit\node_modules\request\request.js:186:22)
269 at Request.emit (events.js:182:13)
270 at Request.<anonymous> (C:\Users\tanya\bloc\bloccit\node_modules\request\request.js:1163:10)
271 at Request.emit (events.js:182:13)
272 at IncomingMessage.<anonymous> (C:\Users\tanya\bloc\bloccit\node_modules\request\request.js:1085:12)
273 at Object.onceWrapper (events.js:273:13)
274 at IncomingMessage.emit (events.js:187:15)
275 at endReadableNT (_stream_readable.js:1094:12)
276 at process._tickCallback (internal/process/next_tick.js:63:19)
277 Message:
278 Expected 'Not Found. Redirecting to /' to contain 'JS Frameworks'.
279 Stack:
280 Error: Expected 'Not Found. Redirecting to /' to contain 'JS Frameworks'.
281 at <Jasmine>
282 at Request.request.get [as _callback] (C:\Users\tanya\bloc\bloccit\spec\integration\topics_spec.js:157:22)
283 at Request.self.callback (C:\Users\tanya\bloc\bloccit\node_modules\request\request.js:186:22)
284 at Request.emit (events.js:182:13)
285 at Request.<anonymous> (C:\Users\tanya\bloc\bloccit\node_modules\request\request.js:1163:10)
286 at Request.emit (events.js:182:13)
287 at IncomingMessage.<anonymous> (C:\Users\tanya\bloc\bloccit\node_modules\request\request.js:1085:12)
288 at Object.onceWrapper (events.js:273:13)
289 at IncomingMessage.emit (events.js:187:15)
290 at endReadableNT (_stream_readable.js:1094:12)
291 at process._tickCallback (internal/process/next_tick.js:63:19)
292
2933) routes : topics POST /topics/:id/update should update the topic with the given values
294 Message:
295 Expected 'JavaScript Frameworks' to be 'JS Frameworks'.
296 Stack:
297 Error: Expected 'JavaScript Frameworks' to be 'JS Frameworks'.
298 at <Jasmine>
299 at Topic.findOne.then (C:\Users\tanya\bloc\bloccit\spec\integration\topics_spec.js:183:33)
300 at tryCatcher (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\util.js:16:23)
301 at Promise._settlePromiseFromHandler (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:512:31)
302 at Promise._settlePromise (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:569:18)
303 at Promise._settlePromise0 (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:614:10)
304 at Promise._settlePromises (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\promise.js:694:18)
305 at _drainQueueStep (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:138:12)
306 at _drainQueue (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:131:9)
307 at Async._drainQueues (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:147:5)
308 at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\tanya\bloc\bloccit\node_modules\bluebird\js\release\async.js:17:14)
309 at runCallback (timers.js:705:18)
310 at tryOnImmediate (timers.js:676:5)
311 at processImmediate (timers.js:658:5)
312
31313 specs, 3 failures
314Finished in 2.049 seconds
315npm ERR! Test failed. See above for more details.