shredder Software Development Kit
$ npm install shredder-sdk --save
'use strict';
var shredder = require('shredder-sdk')
shredder.api.updateConfig({
master: {
host: 'api.shredder.io',
port: 5980
}
})
//store the user session
var session = {}
//setup our api and login
var api = shredder.api.master()
api.postAsync({
url: api.url('/user/login'),
json: {
username: 'myusername',
password: 'mypassword'
}
})
.spread(api.validateResponse())
.spread(function(res,body){
console.log(body)
session = body.session
})
.catch(api.handleNetworkError)
.catch(shredder.NetworkError,function(err){
console.log('A network error occurred: ' + err.message)
})
'use strict';
var shredder = require('shredder-sdk')
shredder.api.updateConfig({
master: {
port: 5980,
host: '127.0.0.1'
}
})
describe('my test',function(){
before(function(){
return shredder.mock.start(5980,'127.0.0.1')
})
after(function(){
return shredder.mock.stop()
})
it('should be up',function(){
var api = shredder.api.master()
return api.postAsync(api.url('/ping'))
.spread(function(res,body){
expect(body.pong).to.equal('pong')
})
})
})
shredder.login(un,pw)
contentExists
to jobContentExists
contentUrl
to jobContentUrl
oose-sdk
1.1.0MaxConcurrencyError
Shredder
helperjob
mockShredder
testingLanguage | javascript |
Version | 1.1.9 |
Git URL | https://github.com/nullivex/shredder-sdk |
License | MIT |
Description | Shredder Software Development Kit |
Keywords |