Skip to content

Commit

Permalink
add test script using chakram.
Browse files Browse the repository at this point in the history
  • Loading branch information
H1Gdev committed Nov 2, 2018
1 parent dd9178a commit 916ba74
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions __tests__/issues494.chakram.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const chakram = require('chakram'),
expect = chakram.expect;
const path = require('path');
const fs = require('fs');

let importCsvApi = 'http://localhost:10011/importcsv';
let sessionToken = 'aaaa';

const contentPath = path.resolve(__dirname, './order.csv');
let content = fs.createReadStream(contentPath);

it('issues 494 using chakram', () => {
let response = chakram.post(importCsvApi, undefined, {
headers: {
'Authorization': sessionToken,
'content-type': 'multipart/form-data'
},
formData: {
file: {
value: content,
options: {
filename: contentPath,
contentType: null
}
}
}
});
expect(response).to.have.status(200);
return chakram.wait();
});

0 comments on commit 916ba74

Please sign in to comment.