Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
Reading the docs makes it seems like params should merge
  • Loading branch information
Zack Seuberling committed May 31, 2019
1 parent 8ba044a commit c035a68
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/specs/core/mergeConfig.spec.js
Expand Up @@ -20,7 +20,7 @@ describe('core::mergeConfig', function() {
var config = {
url: '__sample url__',
method: '__sample method__',
params: '__sample params__',
params: { foo: true },
data: { foo: true }
};
var merged = mergeConfig(defaults, config);
Expand All @@ -34,23 +34,24 @@ describe('core::mergeConfig', function() {
var localDefaults = {
url: '__sample url__',
method: '__sample method__',
params: '__sample params__',
data: { foo: true }
};
var merged = mergeConfig(localDefaults, {});
expect(merged.url).toEqual(undefined);
expect(merged.method).toEqual(undefined);
expect(merged.params).toEqual(undefined);
expect(merged.data).toEqual(undefined);
});

it('should merge auth, headers, proxy with defaults', function() {
it('should merge auth, headers, params, proxy with defaults', function() {
expect(mergeConfig({ auth: undefined }, { auth: { user: 'foo', pass: 'test' } })).toEqual({
auth: { user: 'foo', pass: 'test' }
});
expect(mergeConfig({ auth: { user: 'foo', pass: 'test' } }, { auth: { pass: 'foobar' } })).toEqual({
auth: { user: 'foo', pass: 'foobar' }
});
expect(mergeConfig({ params: { foo: 'test' } }, { params: { bar: 'baz' } })).toEqual({
params: { foo: 'test', bar: 'baz' }
});
});

it('should overwrite auth, headers, proxy with a non-object value', function() {
Expand Down

0 comments on commit c035a68

Please sign in to comment.