Skip to content

Commit

Permalink
fix: Use Object.assign
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaledgarbaya committed Sep 19, 2017
1 parent f7b53e2 commit 45842f5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/create-contentful-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default function createClientApi ({ http }) {
return http.get('', {
baseURL
})
.then((response) => wrapUser(http, response.data), errorHandler)
.then((response) => wrapUser(http, response.data), errorHandler)
}
/**
* Make a custom request to the Contentful management API's /spaces endpoint
Expand Down
1 change: 0 additions & 1 deletion lib/entities/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ export function wrapUser (http, data) {
enhanceWithMethods(user, {})
return freezeSys(user)
}

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"docs:watch": "nodemon --exec npm run docs:dev -w lib",
"docs:publish": "npm run docs:build && ./node_modules/contentful-sdk-jsdoc/bin/publish-docs.sh contentful-management.js contentful-management",
"lint": "eslint lib test",
"format": "eslint --fix lib test",
"pretest": "rimraf coverage && npm run lint",
"test": "npm run test:cover && npm run test:integration && npm run test:browser-local && npm run test:size",
"test:ci": "./node_modules/contentful-sdk-core/bin/test-ci.sh",
Expand Down
8 changes: 4 additions & 4 deletions test/integration/integration-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ test('Gets organizations', (t) => {
test('Gets User', (t) => {
t.plan(2)
return client.getCurrentUser()
.then((user) => {
t.ok(user, 'user')
t.ok(user.sys, 'user.sys')
})
.then((user) => {
t.ok(user, 'user')
t.ok(user.sys, 'user.sys')
})
})

test('Gets space', (t) => {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/mocks/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const spaceMock = {
}

const userMock = {
sys: assign(cloneDeep(sysMock), {
sys: Object.assign(cloneDeep(sysMock), {
type: 'User'
}),
firstName: 'Dwight',
Expand Down

0 comments on commit 45842f5

Please sign in to comment.