We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0d4c00 commit b15c691Copy full SHA for b15c691
test/unit/test.base_service.js
@@ -124,4 +124,17 @@ describe('BaseService', function() {
124
};
125
assert.deepEqual(actual, expected);
126
});
127
+
128
+ it('should set header with access_token parameter', function() {
129
+ const token = 'abc-1234';
130
+ const instance = new TestService({ access_token: token });
131
+ assert.equal(instance._options.headers['Authorization'], `Bearer ${token}`);
132
+ });
133
134
+ it('should update header with setAccessToken', function() {
135
+ const instance = new TestService({ access_token: 'abc-1234' });
136
+ const newToken = 'zyx-9876';
137
+ instance.setAccessToken(newToken);
138
+ assert.equal(instance._options.headers['Authorization'], `Bearer ${newToken}`);
139
140
0 commit comments