process.env.NODE_ENV = 'test'; const chai = require('chai'); const dirtyChai = require('dirty-chai'); chai.use(dirtyChai); const chaiXml = require('chai-xml'); chai.use(chaiXml); const chaiHttp = require('chai-http'); const assert = chai.assert; const expect = chai.expect; const should = chai.should(); // actually call the function const libs = `${process.cwd()}/libs`; const server = require(`${libs}/app`); chai.use(chaiHttp); describe('request distribution factor', () => { // it('should list default distribution factor', (done) => { // chai.request(server) // .get('/api/v1/distribution_factor') // .end((err, res) => { // res.should.have.status(200); // res.should.be.json; // res.body.should.have.property('result'); // res.body.result.should.be.a('array'); // res.body.result[0].should.have.property('city_id'); // res.body.result[0].should.have.property('series'); // res.body.result[0].series[0].should.have.property('serie_id'); // res.body.result[0].series[0].should.have.property('distribution_factor_reduction'); // done(); // }); // }); // it('should list distribution factor with valid filters', (done) => { // chai.request(server) // .get('/api/v1/distribution_factor?filter=state:41,city:4100103') // .end((err, res) => { // res.should.have.status(200); // res.should.be.json; // res.body.should.have.property('result'); // res.body.result.should.be.a('array'); // res.body.result[0].should.have.property('city_id'); // res.body.result[0].should.have.property('series'); // res.body.result[0].series[0].should.have.property('serie_id'); // done(); // }); // }); // it('should list distribution factor with valid filters', (done) => { // chai.request(server) // .get('/api/v1/distribution_factor?filter=city:1100023') // .end((err, res) => { // res.should.have.status(200); // res.should.be.json; // res.body.should.have.property('result'); // res.body.result.should.be.a('array'); // res.body.result[0].should.have.property('city_id'); // res.body.result[0].should.have.property('series'); // res.body.result[0].series[0].should.have.property('serie_id'); // res.body.result[0].series[0].should.have.property('distribution_factor_addition'); // done(); // }); // }); });