Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-data-adapter-tests

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-data-adapter-tests - npm Package Compare versions

Comparing version 2.0.0-alpha.7 to 2.0.0-alpha.8

4

CHANGELOG.md

@@ -0,1 +1,5 @@

##### 2.0.0-alpha.8 - 26 February 2016
- destroy and destroyAll no longer have return values
##### 2.0.0-alpha.7 - 26 February 2016

@@ -2,0 +6,0 @@

2

package.json

@@ -5,3 +5,3 @@ {

"homepage": "https://github.com/js-data/js-data-adapter-tests",
"version": "2.0.0-alpha.7",
"version": "2.0.0-alpha.8",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

@@ -73,9 +73,9 @@ /* global assert:true */

// Test re-assignment
return Promise.resolve(1234)
return Promise.resolve('foo')
}
assert.debug('destroy', User.name, userId)
const destroyedUser = await adapter.destroy(User, userId)
const destroyedUser = await adapter.destroy(User, userId, { raw: true })
assert.debug('destroyed', User.name, destroyedUser)
assert.equal(destroyedUser, 1234, 'destroyedUser')
assert.equal(destroyedUser, 'foo', 'destroyedUser')
assert.isTrue(beforeDestroyCalled, 'beforeDestroy should have been called')

@@ -121,18 +121,3 @@ assert.isTrue(afterDestroyCalled, 'afterDestroy should have been called')

})
it('should destroy a user and return deleted id', async function () {
const adapter = this.$$adapter
const User = this.$$User
const props = { name: 'John' }
assert.debug('create', User.name, props)
let user = await adapter.create(User, props)
let userId = user[User.idAttribute]
assert.debug('created', User.name, user)
assert.debug('destroy', User.name, userId)
const destroyedUser = await adapter.destroy(User, userId, { returnDeletedIds: true })
assert.debug('destroyed', User.name, destroyedUser)
assert.equal(destroyedUser, userId, 'destroyedUser')
})
})
}

@@ -79,40 +79,3 @@ /* global assert:true */

})
it('should optionally return ids', async function () {
const adapter = this.$$adapter
const User = this.$$User
const props = { name: 'John' }
assert.debug('create', User.name, props)
const user = await adapter.create(User, props)
const userId = user[User.idAttribute]
assert.debug('created', User.name, user)
assert.debug('create', User.name, { name: 'Sally' })
const user2 = await adapter.create(User, { name: 'Sally' })
assert.debug('created', User.name, user2)
assert.debug('findAll', User.name, props)
let foundUsers = await adapter.findAll(User, props)
assert.debug('found', User.name, foundUsers)
assert.equal(foundUsers.length, 1, 'foundUsers.length')
assert.equal(foundUsers[0][User.idAttribute], userId, 'foundUsers[0][User.idAttribute]')
assert.equal(foundUsers[0].name, 'John', 'foundUsers[0].name')
assert.debug('destroyAll', User.name, props)
const destroyedUsers = await adapter.destroyAll(User, props, { returnDeletedIds: true })
assert.debug('destroyed', User.name, destroyedUsers)
assert.equal(destroyedUsers.length, 1, 'destroyedUsers.length')
assert.deepEqual(destroyedUsers, [userId], 'destroyedUsers')
assert.debug('findAll', User.name, props)
foundUsers = await adapter.findAll(User, props)
assert.debug('found', User.name, foundUsers)
assert.equal(foundUsers.length, 0)
assert.debug('findAll', User.name, {})
foundUsers = await adapter.findAll(User, {})
assert.debug('found', User.name, foundUsers)
assert.equal(foundUsers.length, 1)
})
})
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc