npm test (see below for logs - there seem to be some errors)
npm start
Open chrome at http://localhost:3000/example/
-> I see the example page, but buttons do not work. Nothing happens on the net and no events trigger.
There is an error on the console:
SW registered
Navigated to http://localhost:3000/example/
(index):65 Uncaught TypeError: Cannot read property 'error' of null
at HTMLConsole.dumpCallback ((index):65)
at (index):182
at WebAuth.parseHash (index.js:110)
at (index):177
HTMLConsole.dumpCallback @ (index):65
(anonymous) @ (index):182
WebAuth.parseHash @ index.js:110
(anonymous) @ (index):177
C:\Devel\auth0.js>npm test
> auth0-js@8.0.1 test C:\Devel\auth0.js
> mocha test/**/*.test.js
auth0.authentication
initialization
√ should check that options is passed
√ should check that domain is set
√ should check that clientID is set
buildAuthorizeUrl
√ should check that options is valid
√ should return a url using the default settings
√ should return a url with connection_scope
√ should return a url with connection_scope as a string
√ should return a url using overriding the default settings
buildAuthorizeUrl with Telemetry
√ should return a url using overriding the default settings
buildLogoutUrl
√ should check that options is valid
√ should return a url using the default settings
√ should ignore the clientID
√ should return a url using overriding the default settings
buildLogoutUrl with Telemetry
√ should return a url using overriding the default settings
userInfo
√ should call userinfo with the access token
delegation
`delegation` will be soon deprecated.
√ should call delegation with all the options
login
√ should call oauthToken with all the options
√ should call oauthToken with all the options
oauthToken
√ should allow to login
getUserCountry
√ should return the user country code
getSSOData
`getSSOData` will be soon deprecated.
√ should call ssodata with all the options
getSSOData
`getSSOData` will be soon deprecated.
√ should call ssodata with all the ad options
auth0.authentication
dbConnection signup options
√ should check that options is passed
√ should check that options.connection is passed
√ should check that options.email is passed
√ should check that options.password is passed
√ should check that cb is valid
change password options
√ should check that options is passed
√ should check that options.connection is passed
√ should check that options.email is passed
√ should check that cb is valid
auth0.authentication
passwordless start options
√ should check that options is passed
√ should check that options.connection is passed
√ should check that options.type is passed
√ should check that options.type is valid
√ should check that cb is valid
√ should check that email is sent
√ should check that phoneNumber is sent
passwordless verify options
√ should check that options is passed
√ should check that options.connection is passed
√ should check that options.type is passed
√ should check that options.verificationCode is passed
√ should check that options.type is valid
√ should check that cb is valid
√ should check that email is sent
√ should check that phoneNumber is sent
passwordless verify
√ should call passwordless verify sms with all the options
√ should call passwordless verify email with all the options
auth0.authentication
/oauth/ro
`loginWithResourceOwner` will be soon deprecated, user `login` instead.
√ should call the ro endpoint with all the parameters
`loginWithResourceOwner` will be soon deprecated, user `login` instead.
√ should handle ro errors
`loginWithResourceOwner` will be soon deprecated, user `login` instead.
√ should call the ro endpoint overriding the parameters
helpers assert
isArray native
√ should say it is a valid isArray
√ should say it is NOT a valid isArray
isArray polyfill
√ should show an error in the console
√ should say it is NOT a valid isArray
helpers cookies
√ create a cookie with exp
√ create a cookie without exp
√ returns null if the cookie does not exist
√ returns the cookie value
√ should handle multiple cookies
√ returns the cookie value (with ;)
√ should reset the expiration
√ handle cookie not available
helpers iframeHandler
should render the iframe
√ and hook to the message event (234ms)
√ and hook to the load event (1084ms)
√ , hook to the load event and returns an error (214ms)
√ and hook to the load event (with invalid hash) should timeout (210ms)
√ and timeout (213ms)
√ and timeout (without a timeout callback) (105ms)
helpers
pick
√ should return only the requested attributes
√ should ignore missing keys
extend
√ shold merge objects attributes
√ shold merge objects attributes and override the first object ones
merge
√ shold merge without pick
√ shold merge picking attributes of the base object
√ shold merge picking attributes of the second object
√ shold merge picking attributes of both objects
blacklist
√ should return all the attributes not blacklisted
toSnakeCase
√ should change the casing to all the attributes
√ should change the casing to all the attributes that are not blacklisted
toCamelCase
√ should change the casing to all the attributes
√ should change the casing to all the attributes that are not blacklisted
helpers popupHandler
calculates the window position
√ should use default values
√ should use the size from the parameters
calculates the window position w screen left/top and body client size
√ should use default values
√ should use the size from the parameters
stringifies the window properties
√ using the options received
should open the popup
√ with the correct parametrs
preload should open the popup
√ should open the window
√ should open the window once
helpers qs
build
√ return the formated query string
parse
√ return the formated query string
build and parse
√ return the formated query string
helpers random
randomString with crypto
√ return the a random string
randomString with msCrypto
√ return the a random string
randomString without crypto
√ return the a random string
helpers requestBuilder
√ should get stuff
√ should post stuff
√ should patch stuff
helpers responseHandler
√ should return default error
√ should return normalized format 1
√ should return normalized format 2
√ should return normalized format 3
√ should return normalized format 4
√ should return normalized format 4
√ should return the data
√ should return the data 2
helpers storage handler
√ should use localStorage by default
√ should use cookie storage is localstorage is not available
Error: fail
at MockLocalStorage.getItem (C:\Devel\auth0.js\test\helper\storage-handler.test.js:10:57)
at StorageHandler.getItem (C:\Devel\auth0.js\src\helper\storage\handler.js:26:25)
at Context.<anonymous> (C:\Devel\auth0.js\test\helper\storage-handler.test.js:54:13)
at callFn (C:\Devel\auth0.js\node_modules\mocha\lib\runnable.js:345:21)
at Test.Runnable.run (C:\Devel\auth0.js\node_modules\mocha\lib\runnable.js:337:7)
at Runner.runTest (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:444:10)
at C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:550:12
at next (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:361:14)
at C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:371:7
at next (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:295:14)
at Immediate._onImmediate (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:339:5)
at tryOnImmediate (timers.js:543:15)
at processImmediate [as _immediateCallback] (timers.js:523:5)
LocalStorage: failing over CookieStorage
√ should use cookie storage is localstorage fails with getItem
Error: fail
at MockLocalStorage.setItem (C:\Devel\auth0.js\test\helper\storage-handler.test.js:12:57)
at StorageHandler.setItem (C:\Devel\auth0.js\src\helper\storage\handler.js:46:25)
at Context.<anonymous> (C:\Devel\auth0.js\test\helper\storage-handler.test.js:81:13)
at callFn (C:\Devel\auth0.js\node_modules\mocha\lib\runnable.js:345:21)
at Test.Runnable.run (C:\Devel\auth0.js\node_modules\mocha\lib\runnable.js:337:7)
at Runner.runTest (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:444:10)
at C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:550:12
at next (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:361:14)
at C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:371:7
at next (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:295:14)
at Immediate._onImmediate (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:339:5)
at tryOnImmediate (timers.js:543:15)
at processImmediate [as _immediateCallback] (timers.js:523:5)
LocalStorage: failing over CookieStorage
√ should use cookie storage is localstorage fails with setItem
Error: fail
at MockLocalStorage.removeItem (C:\Devel\auth0.js\test\helper\storage-handler.test.js:11:60)
at StorageHandler.removeItem (C:\Devel\auth0.js\src\helper\storage\handler.js:36:25)
at Context.<anonymous> (C:\Devel\auth0.js\test\helper\storage-handler.test.js:110:13)
at callFn (C:\Devel\auth0.js\node_modules\mocha\lib\runnable.js:345:21)
at Test.Runnable.run (C:\Devel\auth0.js\node_modules\mocha\lib\runnable.js:337:7)
at Runner.runTest (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:444:10)
at C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:550:12
at next (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:361:14)
at C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:371:7
at next (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:295:14)
at Immediate._onImmediate (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:339:5)
at tryOnImmediate (timers.js:543:15)
at processImmediate [as _immediateCallback] (timers.js:523:5)
LocalStorage: failing over CookieStorage
√ should use cookie storage is localstorage fails with removeItem
LocalStorage: failing over CookieStorage
CookieStorage: failing over DummyStorage
DummyStorage: ignore failover
√ should failover to dummy
helpers storage
with localstorage
√ should store stuff
without localstorage and with cookies
Error: localStorage not available
at Object.localStorage.getItem (C:\Devel\auth0.js\test\helper\storage.test.js:47:44)
at StorageHandler.getItem (C:\Devel\auth0.js\src\helper\storage\handler.js:26:25)
at Object.module.exports.getItem (C:\Devel\auth0.js\src\helper\storage.js:13:30)
at Context.<anonymous> (C:\Devel\auth0.js\test\helper\storage.test.js:62:22)
at callFn (C:\Devel\auth0.js\node_modules\mocha\lib\runnable.js:345:21)
at Test.Runnable.run (C:\Devel\auth0.js\node_modules\mocha\lib\runnable.js:337:7)
at Runner.runTest (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:444:10)
at C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:550:12
at next (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:361:14)
at C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:371:7
at next (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:295:14)
at Immediate._onImmediate (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:339:5)
at tryOnImmediate (timers.js:543:15)
at processImmediate [as _immediateCallback] (timers.js:523:5)
LocalStorage: failing over CookieStorage
√ should store stuff
with dummy storage
Error: cookie storage not available
at Object.read (C:\Devel\auth0.js\src\helper\cookies.js:32:11)
at CookieStorage.getItem (C:\Devel\auth0.js\src\helper\storage\cookie.js:7:18)
at StorageHandler.getItem (C:\Devel\auth0.js\src\helper\storage\handler.js:26:25)
at Object.module.exports.getItem (C:\Devel\auth0.js\src\helper\storage.js:13:30)
at Context.<anonymous> (C:\Devel\auth0.js\test\helper\storage.test.js:89:22)
at callFn (C:\Devel\auth0.js\node_modules\mocha\lib\runnable.js:345:21)
at Test.Runnable.run (C:\Devel\auth0.js\node_modules\mocha\lib\runnable.js:337:7)
at Runner.runTest (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:444:10)
at C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:550:12
at next (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:361:14)
at C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:371:7
at next (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:295:14)
at Immediate._onImmediate (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:339:5)
at tryOnImmediate (timers.js:543:15)
at processImmediate [as _immediateCallback] (timers.js:523:5)
CookieStorage: failing over DummyStorage
√ should ignore the data
helpers warn
√ should show a warning in the console
√ should not show a warning in the console
helpers window
√ should redirect
√ should return the window.document object
√ should return the window object
auth0.Management
initialization
√ should check that options is passed
√ should check that domain is set
√ should check that token is set
getUser options
√ should check that userId is valid
√ should check that cb is valid
getUser
√ should fetch the user from the api
patchUserMetadata options
√ should check that userId is valid
√ should check that userMetadata is valid
√ should check that cb is valid
patchUserMetadata
√ should fetch the user from the api
linkUsers options
√ should check that userId is valid
√ should check that secondaryUserToken is valid
√ should check that cb is valid
linkUsers
√ should fetch the user from the api
auth0.WebAuth.popup
getPopupHandler
√ should return a new instance
√ should return not a new instance
preload should open the popup
√ should open the window
authorize
√ should open the authorize page in a popup
login
`webauth.popup.loginWithCredentials` will be soon deprecated, use `webauth.client.login` instead.
√ should do the redirections in the popup
passwordlessVerify
`loginWithResourceOwner` will be soon deprecated, user `login` instead.
√ (phone) should do the redirections in the popup
`loginWithResourceOwner` will be soon deprecated, user `login` instead.
√ (email) should do the redirections in the popup
√ should propagate the error
signup and login
`webauth.popup.loginWithCredentials` will be soon deprecated, use `webauth.client.login` instead.
√ should call db-connection signup with all the options
√ should propagate signup errors
auth0.WebAuth.redirect
signup
√ should call db-connection signup with all the options
login
`webauth.redirect.loginWithCredentials` will be soon deprecated, use `webauth.login` instead.
√ should authenticate the user, render the callback form and submit it
login
`webauth.redirect.loginWithCredentials` will be soon deprecated, use `webauth.login` instead.
√ should propagate the error
signup and login
`webauth.redirect.loginWithCredentials` will be soon deprecated, use `webauth.login` instead.
√ should call db-connection signup with all the options
√ should propagate signup errors
passwordlessVerify
√ should verify the code and redirect to the passwordless verify page
passwordlessVerify without telemetry
√ should verify the code and redirect to the passwordless verify page
passwordlessVerify with error
√ should verify the code and redirect to the passwordless verify page
authenticate
√ should check that responseType is present
√ should redirect to authorize
√ should redirect to logout
auth0.WebAuth
nonce validation
√ should fail if the nonce is not valid
paseHash
Error: expected 'com.auth0.auth.theState' to equal 'com.auth0.auth.456'
at Assertion.assert (C:\Devel\auth0.js\node_modules\expect.js\expect.js:99:13)
at Assertion.be.Assertion.equal (C:\Devel\auth0.js\node_modules\expect.js\expect.js:200:10)
at Assertion.(anonymous function) [as be] (C:\Devel\auth0.js\node_modules\expect.js\expect.js:73:24)
at Object.global.window.localStorage.getItem (C:\Devel\auth0.js\test\web-auth\web-auth.test.js:27:24)
at StorageHandler.getItem (C:\Devel\auth0.js\src\helper\storage\handler.js:26:25)
at Object.module.exports.getItem (C:\Devel\auth0.js\src\helper\storage.js:13:30)
at TransactionManager.getStoredTransaction (C:\Devel\auth0.js\src\web-auth\transaction-manager.js:55:29)
at WebAuth.validateToken (C:\Devel\auth0.js\src\web-auth\index.js:154:41)
at WebAuth.parseHash (C:\Devel\auth0.js\src\web-auth\index.js:114:10)
at Context.<anonymous> (C:\Devel\auth0.js\test\web-auth\web-auth.test.js:96:26)
at callFnAsync (C:\Devel\auth0.js\node_modules\mocha\lib\runnable.js:368:21)
at Test.Runnable.run (C:\Devel\auth0.js\node_modules\mocha\lib\runnable.js:318:7)
at Runner.runTest (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:444:10)
at C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:550:12
at next (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:361:14)
at C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:371:7
at next (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:295:14)
at Immediate._onImmediate (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:339:5)
at tryOnImmediate (timers.js:543:15)
at processImmediate [as _immediateCallback] (timers.js:523:5)
LocalStorage: failing over CookieStorage
TypeError: Cannot read property 'cookie' of undefined
at Object.read (C:\Devel\auth0.js\src\helper\cookies.js:30:34)
at CookieStorage.getItem (C:\Devel\auth0.js\src\helper\storage\cookie.js:7:18)
at StorageHandler.getItem (C:\Devel\auth0.js\src\helper\storage\handler.js:26:25)
at StorageHandler.getItem (C:\Devel\auth0.js\src\helper\storage\handler.js:30:17)
at Object.module.exports.getItem (C:\Devel\auth0.js\src\helper\storage.js:13:30)
at TransactionManager.getStoredTransaction (C:\Devel\auth0.js\src\web-auth\transaction-manager.js:55:29)
at WebAuth.validateToken (C:\Devel\auth0.js\src\web-auth\index.js:154:41)
at WebAuth.parseHash (C:\Devel\auth0.js\src\web-auth\index.js:114:10)
at Context.<anonymous> (C:\Devel\auth0.js\test\web-auth\web-auth.test.js:96:26)
at callFnAsync (C:\Devel\auth0.js\node_modules\mocha\lib\runnable.js:368:21)
at Test.Runnable.run (C:\Devel\auth0.js\node_modules\mocha\lib\runnable.js:318:7)
at Runner.runTest (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:444:10)
at C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:550:12
at next (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:361:14)
at C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:371:7
at next (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:295:14)
at Immediate._onImmediate (C:\Devel\auth0.js\node_modules\mocha\lib\runner.js:339:5)
at tryOnImmediate (timers.js:543:15)
at processImmediate [as _immediateCallback] (timers.js:523:5)
CookieStorage: failing over DummyStorage
√ should parse a valid hash (737ms)
√ should parse a valid hash from the location.hash
√ should parse a valid hash without id_token
√ should fail with an invalid audience
√ should fail with an invalid issuer
√ should fail if there is no token
√ should parse an error response
renewAuth
√ should pass the correct authorize url
login
√ should check that responseType is present
renewAuth
√ should validate the token (818ms)
√ should return the access_token
√ should validate the token and fail
change password
√ should call db-connection changePassword with all the options
√ should call db-connection changePassword should ignore password option
passwordless start
√ should call passwordless start sms with all the options
√ should call passwordless start email with all the options
signup and login
√ should call db-connection signup with all the options
√ should propagate signup errors
175 passing (4s)
C:\Devel\auth0.js>
Hi, I've just cloned the repository and I have problems running tests in a windows command line, some tests fail:
Am I missing anything?
NPM INSTALL LOGS:
NPM TEST LOGS: