本文整理匯總了TypeScript中should.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了default函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('calls with proper params', function() {
this.api.login('foo', 'bar')
const [url, opts] = fetchMock.lastCall('login')
should(url).endWith('login')
should(opts.body).containEql('username=foo')
should(opts.body).containEql('password=bar')
})
示例2: should
return this.api.remove(objCode, objID).catch(function(error) {
should(error).have.properties('message', 'status')
should(error).not.have.property('success')
const [url, opts] = fetchMock.lastCall('remove')
should(url).endWith(`${objCode}/${objID}`)
should(opts.method).equal('DELETE')
})
示例3: it
it('should call with proper params', function() {
this.api.logout()
const [url, opts] = fetchMock.lastCall('logout')
should(url).endWith('logout')
should(opts.method).equal('GET')
should(opts.body).be.null()
})
示例4: should
return this.api.logout('foo', 'bar').then(() => {
opts = fetchMock.lastOptions('logout')
should(opts.headers.has('sessionID')).be.ok()
this.api.login('foo', 'bar')
opts = fetchMock.lastOptions('login')
should(opts.headers.has('sessionID')).not.be.ok()
})
示例5: it
it('calls without objCode', function() {
this.api.metadata()
const [url, opts] = fetchMock.lastCall('metadata')
should(url).endWith('metadata')
should(opts.method).equal('GET')
should(opts.body).be.null()
})
示例6: should
return this.api.execute('foo', null, 'baz').then(function() {
const [url, opts] = fetchMock.lastCall('execute')
should(url).endWith('foo')
should(opts.body).containEql('action=baz')
should(opts.body).containEql('method=PUT')
should(opts.method).equal('POST')
})
示例7: should
return this.api.copy('foo', 'bar', {name: 'Copy of bar'}).then(function() {
const [url, opts] = fetchMock.lastCall('copy')
should(url).endWith('foo')
should(opts.method).equal('POST')
should(opts.body).containEql('updates=' + encodeURIComponent('{"name":"Copy of bar"}'))
should(opts.body).containEql('copySourceID=bar')
should(opts.body).not.containEql('options')
})
示例8: should
return this.api.get(objCode, objID).then(function(data) {
const [url, opts] = fetchMock.lastCall('get')
should(opts.method).equal('GET')
should(url).endWith(objCode + '/' + objID[0])
should(opts.body).be.null()
should(data).have.properties(['ID', 'name', 'objCode'])
})