Skip to content

Commit af50ac0

Browse files
author
Eric Koleda
committed
Add a test for getToken(true)
1 parent 09d5d9d commit af50ac0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,23 @@ describe('Service', function() {
9191
assert.equal(cache.counter, cacheStart);
9292
assert.equal(properties.counter, propertiesStart);
9393
});
94+
95+
it('should skip the local memory cache when desired', function() {
96+
var properties = new MockProperties();
97+
var service = OAuth2.createService('test')
98+
.setPropertyStore(properties);
99+
var token = {
100+
access_token: 'foo'
101+
};
102+
service.saveToken_(token);
103+
104+
var newToken = {
105+
access_token: 'bar'
106+
};
107+
properties.setProperty('oauth2.test', JSON.stringify(newToken));
108+
109+
assert.deepEqual(service.getToken(true), newToken);
110+
});
94111
});
95112

96113
describe('#saveToken_()', function() {

0 commit comments

Comments
 (0)