Making syntax corrections and checking tests.

This commit is contained in:
Zachary Elliott 2024-08-03 20:49:47 -06:00
parent e7976e95e1
commit f058feaee9
3 changed files with 10 additions and 5 deletions

View File

@ -16,7 +16,7 @@ const bodyTextBegin = regex(/^body\s*\(\s*type\s*=\s*text\s*\)\s*\r?\n/);
// body(type=xml)
const bodyXmlBegin = regex(/^body\s*\(\s*type\s*=\s*xml\s*\)\s*\r?\n/);
// body(type=rawFile)
// body(type=raw-file)
const bodyRawFile = regex(/^body\s*\(\s*type\s*=\s*raw-file\s*\)\s*\r?\n/);
const bodyEnd = regex(/^[\r?\n]+\/body\s*[\r?\n]*/);
@ -66,13 +66,13 @@ const bodyXmlTag = between(bodyXmlBegin)(bodyEnd)(everyCharUntil(bodyEnd)).map((
});
const bodyRawFileTag = between(bodyRawFile)(bodyEnd)(everyCharUntil(bodyEnd)).map((bodyRawFile)) => {
const bodyRawFileTag = between(bodyRawFile)(bodyEnd)(everyCharUntil(bodyEnd)).map((bodyRawFile) => {
return {
body: {
rawFile: bodyRawFile
}
}
}
};
});
/**
* We have deprecated form-url-encoded type in body tag, it was a misspelling on my part

View File

@ -50,6 +50,10 @@ body(type=multipart-form)
0 password governingdynamics
/body
body(type=raw-file)
/test/file.txt
/body
script
const foo='bar';
/script

View File

@ -77,7 +77,8 @@ describe('bruToJson', () => {
name: 'password',
value: 'governingdynamics'
}
]
],
rawFile: '/test/file.txt'
},
script: "const foo='bar';",
tests: "bruno.test('200 ok', () => {});"