-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from oat-sa/release-1.1.0
Release 1.1.0
- Loading branch information
Showing
5 changed files
with
60 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,12 +21,13 @@ | |
* | ||
* @author Martin Nicholson <[email protected]> | ||
*/ | ||
define(['jquery', 'lodash', 'core/request', 'core/tokenHandler', 'core/jwt/jwtTokenHandler', 'jquery.mockjax'], function( | ||
define(['jquery', 'lodash', 'core/request', 'core/tokenHandler', 'core/jwt/jwtTokenHandler', 'core/logger', 'jquery.mockjax'], function( | ||
$, | ||
_, | ||
request, | ||
tokenHandlerFactory, | ||
jwtTokenHandlerFactory | ||
jwtTokenHandlerFactory, | ||
loggerFactory | ||
) { | ||
'use strict'; | ||
|
||
|
@@ -848,4 +849,28 @@ define(['jquery', 'lodash', 'core/request', 'core/tokenHandler', 'core/jwt/jwtTo | |
'request fails if token handler cannot provide access token' | ||
); | ||
}); | ||
|
||
QUnit.module('request logger', { | ||
afterEach: function() { | ||
$.mockjax.clear(); | ||
} | ||
}); | ||
|
||
QUnit.cases.init(['warn', 'error', 'fatal']).test('request logger min level is set based on config', (logLevel, assert) => { | ||
const done = assert.async(); | ||
assert.expect(1); | ||
|
||
$.mockjax([ | ||
{ | ||
url: '//endpoint', | ||
status: 200, | ||
responseText: JSON.stringify({}) | ||
} | ||
]); | ||
|
||
request({ url: '//endpoint', noToken: true, logLevel }).then(() => { | ||
assert.equal(loggerFactory().loggerLevel, logLevel, `loggel level should be ${logLevel} based on config`); | ||
done(); | ||
}); | ||
}); | ||
}); |