Lewis John McGibbney created SENSSOFT-286:
---------------------------------------------
Summary: Ensure all UserALE.js tests pass with npm run test
Key: SENSSOFT-286
URL: https://issues.apache.org/jira/browse/SENSSOFT-286
Project: SensSoft
Issue Type: Task
Components: UserALE.js
Affects Versions: UserALE.js 1.0.0
Reporter: Lewis John McGibbney
Assignee: Rob Foley
Fix For: UserALE.js 1.1.0
npm run test fails with the following
{code}
> [email protected] pretest /usr/local/incubator-senssoft-useralejs
> gulp lint
[19:10:47] Using gulpfile /usr/local/incubator-senssoft-useralejs/gulpfile.js
[19:10:47] Starting 'lint'...
[19:10:47] Finished 'lint' after 288 ms
> [email protected] test /usr/local/incubator-senssoft-useralejs
> gulp test
[19:10:48] Using gulpfile /usr/local/incubator-senssoft-useralejs/gulpfile.js
[19:10:48] Starting 'rollup'...
[19:10:48] Starting 'lint'...
[19:10:48] Finished 'rollup' after 100 ms
[19:10:48] Starting 'build'...
[19:10:48] Finished 'lint' after 548 ms
[19:10:48] Finished 'build' after 451 ms
[19:10:48] Starting 'test'...
attachHandlers
✓ attaches all the event handlers without duplicates
✓ debounces bufferedEvents (503ms)
defineDetails
- configures high detail events correctly
configure
✓ merges new configs into main config object
✓ includes a userid if present in the window.location
getUserIdFromParams
✓ fetches userId from URL params
✓ returns null if no matching param
getInitialSettings
timeStampScale
✓ no event.timestamp
✓ zero
✓ epoch milliseconds
✓ epoch microseconds
✓ performance navigation time
getInitialSettings
1) fetches all settings from a script tag
2) grabs user id from params
Userale API
3) provides configs
4) edits configs
5) starts + stops
6) sends custom logs
packageLogs
packageLog
✓ only executes if on
✓ calls detailFcn with the event as an argument if provided
✓ packages logs
getLocation
✓ returns event page location
✓ calculates page location if unavailable
✓ fails to null
selectorizePath
✓ returns a new array of the same length provided
getSelector
✓ builds a selector
✓ identifies window
✓ handles a non-null unknown value
buildPath
✓ builds a path
✓ defaults to path if available
sendLogs
✓ sends logs on an interval
✓ sends logs on page exit with navigator
✓ sends logs on page exit without navigator
26 passing (837ms)
1 pending
6 failing
1) getInitialSettings getInitialSettings fetches all settings from a script
tag:
Uncaught TypeError: Cannot read property 'options' of undefined
at Object.done (test/getInitialSettings_spec.js:78:26)
at process.nextTick (node_modules/jsdom/lib/jsdom.js:297:18)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
2) getInitialSettings getInitialSettings grabs user id from params:
Uncaught TypeError: Cannot read property 'options' of undefined
at Object.done (test/getInitialSettings_spec.js:105:26)
at process.nextTick (node_modules/jsdom/lib/jsdom.js:297:18)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
3) Userale API provides configs:
Uncaught TypeError: Cannot read property 'options' of undefined
at Object.done (test/main_spec.js:33:24)
at process.nextTick (node_modules/jsdom/lib/jsdom.js:297:18)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
4) Userale API edits configs:
Uncaught TypeError: Cannot read property 'options' of undefined
at Object.done (test/main_spec.js:60:24)
at process.nextTick (node_modules/jsdom/lib/jsdom.js:297:18)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
5) Userale API starts + stops:
Uncaught TypeError: Cannot read property 'options' of undefined
at Timeout._onTimeout (test/main_spec.js:80:18)
6) Userale API sends custom logs:
Uncaught TypeError: Cannot read property 'log' of undefined
at Object.done (test/main_spec.js:101:16)
at process.nextTick (node_modules/jsdom/lib/jsdom.js:297:18)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
[19:10:50] { [Error: 6 tests failed.]
message: '6 tests failed.',
showStack: false,
showProperties: true,
plugin: 'gulp-mocha',
__safety: { toString: [Function: bound ] } }
[19:10:50] Finished 'test' after 1.89 s
{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)