Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Running "test" task
- (node:19744) DeprecationWarning: sys is deprecated. Use util instead.
- Running "env:test" (env) task
- Running "eslint:all" (eslint) task
- Running "jsonlint:all" (jsonlint) task
- >> 63 files lint free.
- Running "mochacli:server" (mochacli) task
- Adding Array.prototype.tap for tests
- Stubbing agenda
- Swagger: skipping unknown type "GeoJSON.Point".
- Swagger: skipping unknown type "GeoJSON.Polygon".
- Stubbing Email
- Agenda ready
- Swagger: skipping unknown type "GeoJSON.Point".
- Swagger: skipping unknown type "GeoJSON.Polygon".
- Forms mounted: 1 success, 0 failures
- Boot sequence completed
- Event
- API
- Wed, 11 Jan 2017 13:05:16 GMT loopback deprecated loopback#context middleware is deprecated. See https://docs.strongloop.com/display/APIC/Using%20current%20context for more details. at node_modules/loopback/server/middleware/rest.js:60:32
- ✓ PUT / should 404 (116ms)
- ✓ GET / should 404
- ✓ GET /findOne should 404
- ✓ GET /count should 404
- ✓ POST /update should 404
- ✓ GET /:id should 404
- ✓ DELETE /:id should 404
- ✓ PUT /:id should 404
- ✓ GET /:id/exists should 404
- ✓ POST /change-stream should 404
- POST
- ✓ should not crash on invalid coordinates (49ms)
- ✓ should return an object `{id:""}` (48ms)
- "gps" event
- ✓ should create an event
- "beacon-scan" event
- ✓ should create an event
- ✓ should have updated the devices
- ✓ OLD >> should have updated the devices
- two scanner reporting SOS
- accessToken >> { ttl: 1209600,
- created: 2017-01-11T13:05:16.592Z,
- userId: 58762d8c7ab1723e4df20a9b,
- resourceId: '_58762d8c7ab1723e4df20a9c',
- organizationId: 'primary',
- id: '12457375429839' }
- Alert created without a scanner. macAddress: AAAAAAAA0123
- accessToken >> { ttl: 1209600,
- created: 2017-01-11T13:05:16.592Z,
- userId: 58762d8c7ab1723e4df20a9b,
- resourceId: '_58762d8c7ab1723e4df20a9c',
- organizationId: 'primary',
- id: '12457375429839' }
- ✓ should only create a single alert (1191ms)
- Event
- model (alerts)
- validation
- #beacons
- ✓ should contain a single item
- #isAlert
- ✓ should be true for "alert.cancel","alert.confirm","alert.resolve"
- #applyAlert
- ✓ should fail when the event is not an "alert.*" event
- ✓ should update the beacons present in the event (along with their resource) (44ms)
- ✓ should update the most recent alert coinciding with the timestamp and update status (76ms)
- ✓ should create an ActivityLog for the action (75ms)
- Event
- model
- #applyBeaconScan
- ✓ should fail when the event is not a "beacon-scan" event
- ✓ should update the beacons present in the event (along with their resource) (68ms)
- ✓ should not update devices that belong to other organization (61ms)
- - AGENDA TESTING: should ignore unprovisionned macAddress
- ✓ should update the scanner's location (along with its resource's)
- ✓ should NOT update scanner location if coordinates are missing
- accessToken >> { userId: 58762d8c7ab1723e4df20a98,
- organizationId: 'event_testing',
- created: 2017-01-11T13:05:16.075Z,
- ttl: 1209600 }
- Alert created without a scanner. macAddress: 012345678911
- ✓ should create an alert for SOS message types (76ms)
- #createAlert
- ✓ should return an Alert for SOS message types (50ms)
- - [DELAYED] should return an for MANDOWN message types
- ✓ should throw an error if no message is found for the macAddress
- ✓ should throw an error on MANDOWN
- ✓ should throw an error if the messageType is not an emergency
- #scannedBeacons
- #getEmergencyMessages()
- accessToken >> { userId: 58762d8c7ab1723e4df20a98,
- organizationId: 'event_testing',
- created: 2017-01-11T13:05:16.075Z,
- ttl: 1209600 }
- ✓ should return SOS but not MANDOWN beaconScans
- ✓ should be empty when there are no emergency
- ✓ should be empty on "gps" events
- #_detectAndHandleEmergencyMesssages
- with no prior events
- accessToken >> { organizationId: 'event_testing' }
- ✓ should create an alert
- but scanned by another organization
- accessToken >> { organizationId: 'event_testingdifferent' }
- ✓ should NOT create an alert
- with a previous event that is not an emergency
- accessToken >> { organizationId: 'event_testing' }
- ✓ should create an alert
- with a previous event that is the same emergency
- accessToken >> { userId: 58762d8c7ab1723e4df20a98,
- organizationId: 'event_testing',
- created: 2017-01-11T13:05:16.075Z,
- ttl: 1209600 }
- Alert created without a scanner. macAddress: 000000000002
- accessToken >> { organizationId: 'event_testing' }
- ✓ should NOT create an alert
- - TODO: should update the alert
- with a next event that is the same emergency
- accessToken >> { userId: 58762d8c7ab1723e4df20a98,
- organizationId: 'event_testing',
- created: 2017-01-11T13:05:16.075Z,
- ttl: 1209600 }
- Alert created without a scanner. macAddress: 000000000002
- accessToken >> { organizationId: 'event_testing' }
- ✓ should NOT create an alert
- - TODO: should update the alert
- Event
- model
- validation
- #event
- ✓ should be required
- enum values
- ✓ gps
- ✓ beacon-scan
- ✓ alert.cancel
- ✓ alert.confirm
- ✓ alert.resolve
- ✓ should not validate other values
- #installationId
- ✓ should be required
- #coordinates
- ✓ should accept array coordinates and convert to point
- ✓ should be required for "gps" events
- ✓ should not be required for "beacon-scan" events
- #beacons
- ✓ should not be validated when empty
- [WHEN NEEDED] #scheduleApplication
- - should schedule the event processing in agenda
- #apply
- ✓ "gps" dispatches to #applyGps
- ✓ "beacon-scan" dispatches to #applyBeaconScan
- ✓ "alert.cancel" dispatches to #applyAlert
- ✓ "alert.confirm" dispatches to #applyAlert
- ✓ "alert.resolve" dispatches to #applyAlert
- it should implement loopback observables
- ✓ should have called "before application" then "apply", then "afterApplication"
- #applyGps
- ✓ should fail when the event is not a "gps" event
- ✓ should update the device's location referenced by `installationId` (along with its resource) (44ms)
- Role Permissions
- $authenticated
- permissions
- /api/v2/Events
- ✓ Hide find GET /
- ✓ Allow create POST /
- ✓ Hide findById GET /:id
- ✓ Hide updateAttributes PUT /:id
- ✓ Hide deleteById DELETE /:id
- ✓ Hide exists GET /:id/exists
- ✓ Hide count GET /count
- ✓ Hide findOne GET /findOne
- ✓ Hide updateAll POST /update
- ✓ Hide upsert PUT /
- Role Permissions
- Admin
- permissions
- /api/v2/Events
- ✓ Hide find GET /
- ✓ Allow create POST /
- ✓ Hide findById GET /:id
- ✓ Hide updateAttributes PUT /:id
- ✓ Hide deleteById DELETE /:id
- ✓ Hide exists GET /:id/exists
- ✓ Hide count GET /count
- ✓ Hide findOne GET /findOne
- ✓ Hide updateAll POST /update
- ✓ Hide upsert PUT /
- Role Permissions
- Foreman
- permissions
- /api/v2/Events
- ✓ Hide find GET /
- ✓ Allow create POST /
- ✓ Hide findById GET /:id
- ✓ Hide updateAttributes PUT /:id
- ✓ Hide deleteById DELETE /:id
- ✓ Hide exists GET /:id/exists
- ✓ Hide count GET /count
- ✓ Hide findOne GET /findOne
- ✓ Hide updateAll POST /update
- ✓ Hide upsert PUT /
- Logout didnt find the token. Usually harmless Error: could not find accessToken
- at /home/lemb/Projects/wyzeio/node_modules/loopback/common/models/user.js:302:12
- at /home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:2011:62
- at /home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:1939:11
- at /home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/node_modules/async/lib/async.js:396:17
- at async.each (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/node_modules/async/lib/async.js:153:20)
- at _asyncMap (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/node_modules/async/lib/async.js:390:13)
- at Object.map (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/node_modules/async/lib/async.js:361:23)
- at allCb (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:1867:15)
- at /home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/lib/mongodb.js:895:9
- at handleCallback (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/utils.js:96:12)
- at /home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/cursor.js:839:16
- at handleCallback (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/cursor.js:159:5)
- at setCursorNotified (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/cursor.js:511:3)
- at /home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/cursor.js:582:16
- at queryCallback (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/cursor.js:220:18)
- at /home/lemb/Projects/wyzeio/node_modules/continuation-local-storage/context.js:84:17
- at bound (domain.js:280:14)
- at runBound (domain.js:293:12)
- at Callbacks.emit (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/topologies/server.js:119:3)
- at Connection.messageHandler (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/topologies/server.js:397:23)
- at Socket.<anonymous> (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/connection/connection.js:302:22)
- at emitOne (events.js:96:13)
- at Socket.emit (events.js:188:7)
- at readableAddChunk (_stream_readable.js:176:18)
- at Socket.Readable.push (_stream_readable.js:134:10)
- at TCP.onread (net.js:548:20)
- From previous event:
- at Object.createPromiseCallback (/home/lemb/Projects/wyzeio/node_modules/loopback/lib/utils.js:19:17)
- at Function.User.logout (/home/lemb/Projects/wyzeio/node_modules/loopback/common/models/user.js:295:22)
- at Object.logout (/home/lemb/Projects/wyzeio/server/test/helpers/api-helpers.js:85:8)
- at Context.after (/home/lemb/Projects/wyzeio/server/test/spec/roles/foreman.spec.js:53:21)
- at callFn (/home/lemb/Projects/wyzeio/node_modules/grunt-mocha-cli/node_modules/mocha/lib/runnable.js:326:21)
- at Hook.Runnable.run (/home/lemb/Projects/wyzeio/node_modules/grunt-mocha-cli/node_modules/mocha/lib/runnable.js:319:7)
- at next (/home/lemb/Projects/wyzeio/node_modules/grunt-mocha-cli/node_modules/mocha/lib/runner.js:298:10)
- at /home/lemb/Projects/wyzeio/node_modules/grunt-mocha-cli/node_modules/mocha/lib/runner.js:315:7
- at done (/home/lemb/Projects/wyzeio/node_modules/grunt-mocha-cli/node_modules/mocha/lib/runnable.js:287:5)
- at /home/lemb/Projects/wyzeio/node_modules/grunt-mocha-cli/node_modules/mocha/lib/runnable.js:331:11
- at /home/lemb/Projects/wyzeio/node_modules/async-listener/glue.js:188:31
- at _combinedTickCallback (internal/process/next_tick.js:67:7)
- at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:122:9)
- Role Permissions
- Project Manager
- permissions
- /api/v2/Events
- ✓ Hide find GET /
- ✓ Allow create POST /
- ✓ Hide findById GET /:id
- ✓ Hide updateAttributes PUT /:id
- ✓ Hide deleteById DELETE /:id
- ✓ Hide exists GET /:id/exists
- ✓ Hide count GET /count
- ✓ Hide findOne GET /findOne
- ✓ Hide updateAll POST /update
- ✓ Hide upsert PUT /
- Role Permissions
- Supervisor
- permissions
- /api/v2/Events
- ✓ Hide find GET /
- ✓ Allow create POST /
- ✓ Hide findById GET /:id
- ✓ Hide updateAttributes PUT /:id
- ✓ Hide deleteById DELETE /:id
- ✓ Hide exists GET /:id/exists
- ✓ Hide count GET /count
- ✓ Hide findOne GET /findOne
- ✓ Hide updateAll POST /update
- ✓ Hide upsert PUT /
- 111 passing (5s)
- 5 pending
- Running "mochacli:sync" (mochacli) task
- Adding Array.prototype.tap for tests
- Stubbing agenda
- Stubbing Email
- Agenda ready
- Forms mounted: 0 success, 0 failures
- Boot sequence completed
- Created 1 FormTemplate:
- Created 1 Organization:
- app.booting false
- Aerial Inspection Notification
- Agenda processing
- - should debounce rapid events and run a single job for the vehicle
- - should run four times then delete itself
- when resource has been stopped less than 4 hours
- - should NOT be triggered
- when resource has been stopped for at least 4 hours
- - should be triggered
- .sendEmailToSupervisors(job)
- - should not fail when no admins
- - should send an email to all admins that haven't opted out
- Job
- process-event
- validation
- ✓ should fail when no data.eventId is present
- ✓ should fail when data.eventId is the wrong format
- running the job
- on "beacon-scan"
- 1) "before all" hook
- 2 passing (178ms)
- 6 pending
- 1 failing
- 1) Job process-event running the job on "beacon-scan" "before all" hook:
- Uncaught AssertionError: accessToken is required
- + expected - actual
- -false
- +true
- at Console.assert (console.js:95:23)
- at ModelConstructor._detectAndHandleEmergencyMesssages (common/models/event.js:375:15)
- at onAfterSaveHandleEmergencies (common/models/event.js:156:49)
- at notifySingleObserver (node_modules/loopback-datasource-juggler/lib/observer.js:103:22)
- at iterate (node_modules/loopback-datasource-juggler/node_modules/async/lib/async.js:181:13)
- at Object.async.eachSeries (node_modules/loopback-datasource-juggler/node_modules/async/lib/async.js:197:9)
- at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:100:11)
- at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at Function.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:121:5)
- at Function.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at ModelConstructor.<anonymous> (node_modules/loopback-datasource-juggler/lib/dao.js:376:23)
- at ModelConstructor.next (node_modules/loopback-datasource-juggler/lib/hooks.js:81:12)
- at ModelConstructor.<anonymous> (node_modules/loopback-datasource-juggler/lib/dao.js:364:26)
- at ModelConstructor.next (node_modules/loopback-datasource-juggler/lib/hooks.js:81:12)
- at node_modules/loopback-datasource-juggler/lib/dao.js:363:22
- at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at Function.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:121:5)
- at Function.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at createCallback (node_modules/loopback-datasource-juggler/lib/dao.js:353:17)
- at node_modules/loopback-connector-mongodb/lib/mongodb.js:346:7
- at _combinedTickCallback (internal/process/next_tick.js:67:7)
- at process._tickDomainCallback (internal/process/next_tick.js:122:9)
- Warning: Use --force to continue.
- Aborted due to warnings.
- Process finished with exit code 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement