Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe('POST /api/products/add', () => {
- it(`Should create ${addProductCount} products with 0...1000 price`, (done) => {
- let operationCount = addProductCount;
- for (let i = 0; i < addProductCount; i++) {
- chai
- .request(server)
- .post('api/products/add')
- .set('token', constants.merchantToken)
- .field('product_name', 'test')
- .field('product_description', 'description description')
- .field('original_price', '20')
- .field('sale_price', '10')
- .field('starting_date', '2019-04-19T17:03:00+00:00')
- .field('end_date', '2019-04-19T20:03:00+00:00')
- .field('quantity_available', '20')
- .field('quantity_available', 'HOME APPLIANCES')
- .attach('product_photos', fs.readFileSync(images1), 'test1.jpeg')
- .attach('product_photos', fs.readFileSync(images2), 'test2.jpg')
- .attach('product_photos', fs.readFileSync(images3), 'test3.png')
- .end((err, res) => {
- operationCount--;
- expect(res).have.status(200);
- expect(res.body).have.property('message');
- expect(res.body.message).to.be.equal('Product added');
- if (operationCount == 0) {
- done();
- }
- });
- }
- });
- });
- Uncaught TypeError: Cannot use 'in' operator to search for 'status' in undefined
- at Proxy.<anonymous> (node_moduleschai-httplibhttp.js:80:38)
- at Proxy.methodWrapper >(node_moduleschailibchaiutilsaddMethod.js:57:25)
- at status (test/productsTest.js:73:42)
- at Test.Request.callback (node_modulessuperagentlibnodeindex.js:728:3)
- at ClientRequest.req.once.err (node_modulessuperagentlibnodeindex.js:647:10)
- at ClientRequest.EventEmitter.emit (domain.js:441:20)
- at Socket.socketErrorListener (_http_client.js:392:9)
- at Socket.EventEmitter.emit (domain.js:441:20)
- at emitErrorNT (internal/streams/destroy.js:82:8)
- at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
- at process._tickCallback (internal/process/next_tick.js:63:19)
- { Error: connect ECONNREFUSED 127.0.0.1:80
- at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1097:14)
- errno: 'ECONNREFUSED',
- code: 'ECONNREFUSED',
- syscall: 'connect',
- address: '127.0.0.1',
- port: 80,
- response: undefined }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement