@dropbug/amazon-mws
Version:
Amazon MWS API wrapper
39 lines (31 loc) • 1.52 kB
JavaScript
;
var config = require('../intialize/config');
var accessKey = config.accessKey;
var accessSecret = config.accessSecret;
var chai = require('chai');
var expect = chai.expect;
var amazonMws = require('../../lib/amazon-mws')(accessKey, accessSecret);
describe('Reports', function () {
before(function () {
expect(accessKey).to.be.a('string');
expect(accessSecret).to.be.a('string');
});
it('It should get report list using GetReportList Action', async function () {
var options = {
'Version': '2009-01-01',
'Action': 'GetReportList',
'SellerId': config.SellerId
};
expect(options.SellerId).to.be.a('string');
var response = await amazonMws.reports.search(options);
expect(response).to.be.a('object');
expect(response).to.have.property('ReportInfo').to.be.a('array');
expect(response).to.have.property('ResponseMetadata').to.be.a('object');
expect(response).to.have.property('ResponseMetadata').to.have.property('RequestId');
expect(response).to.have.property('Headers').to.be.a('object');
expect(response).to.have.property('Headers').to.have.property('x-mws-quota-max');
expect(response).to.have.property('Headers').to.have.property('x-mws-quota-remaining');
expect(response).to.have.property('Headers').to.have.property('x-mws-quota-resetson');
expect(response).to.have.property('Headers').to.have.property('x-mws-timestamp');
});
});