mirror of
https://github.com/usebruno/bruno.git
synced 2025-08-18 16:29:30 +02:00
temp. revert tests for file body (#3941)
* temporarily revert tests for file body
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
meta {
|
||||
name: echo file body
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{echo-host}}
|
||||
body: file
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:file {
|
||||
file: @file(ping.bru) @contentType(bru)
|
||||
}
|
||||
|
||||
tests {
|
||||
test("should return bru file body contents", function() {
|
||||
const data = res.getBody();
|
||||
const expectedData = `meta {
|
||||
name: ping
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{host}}/ping
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
`;
|
||||
expect(res.getBody()).to.eql(expectedData);
|
||||
});
|
||||
|
||||
|
||||
test("should return proper header", function() {
|
||||
const contentType = res.getHeader('content-type');
|
||||
expect(contentType).to.eql('bru');
|
||||
});
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
meta {
|
||||
name: echo image body
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{echo-host}}
|
||||
body: file
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:file {
|
||||
file: @file(bruno.png) @contentType(image/png)
|
||||
}
|
||||
|
||||
tests {
|
||||
test("should return proper header", function() {
|
||||
const contentType = res.getHeader('content-type');
|
||||
expect(contentType).to.eql('image/png');
|
||||
});
|
||||
}
|
@@ -1,55 +0,0 @@
|
||||
meta {
|
||||
name: echo json file body
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{echo-host}}
|
||||
body: file
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:file {
|
||||
file: @file(file.json) @contentType(application/json; charset=utf-8)
|
||||
}
|
||||
|
||||
tests {
|
||||
test("should return json file body contents buffer", function() {
|
||||
const data = res.getBody();
|
||||
expect(res.getBody()).to.eql({
|
||||
"type": "Buffer",
|
||||
"data": [
|
||||
123,
|
||||
10,
|
||||
32,
|
||||
32,
|
||||
34,
|
||||
104,
|
||||
101,
|
||||
108,
|
||||
108,
|
||||
111,
|
||||
34,
|
||||
58,
|
||||
32,
|
||||
34,
|
||||
98,
|
||||
114,
|
||||
117,
|
||||
110,
|
||||
111,
|
||||
34,
|
||||
10,
|
||||
125,
|
||||
10
|
||||
]
|
||||
});
|
||||
});
|
||||
|
||||
test("should return proper header", function() {
|
||||
const contentType = res.getHeader('content-type');
|
||||
expect(contentType).to.eql('application/json; charset=utf-8');
|
||||
});
|
||||
|
||||
}
|
@@ -1,30 +0,0 @@
|
||||
meta {
|
||||
name: echo text file body
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{echo-host}}
|
||||
body: file
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:file {
|
||||
file: @file(file.txt) @contentType(text/plain; charset=utf-8)
|
||||
}
|
||||
|
||||
tests {
|
||||
test("should return json file body contents", function() {
|
||||
const data = res.getBody();
|
||||
const expectedData = `file.txt
|
||||
|
||||
hello, bruno`;
|
||||
expect(res.getBody()).to.eql(expectedData);
|
||||
});
|
||||
|
||||
test("should return proper header", function() {
|
||||
const contentType = res.getHeader('content-type');
|
||||
expect(contentType).to.eql('text/plain; charset=utf-8');
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user