Skip to content

Commit dd31b4d

Browse files
committed
Add test for maxBodyLength
Add test to assure that maxBodyLength is present as Infinity
1 parent cd54b26 commit dd31b4d

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed

.vscode/launch.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Mocha (Test single file)",
6+
"type": "node",
7+
"request": "launch",
8+
"runtimeArgs": [
9+
"${workspaceRoot}/node_modules/.bin/mocha",
10+
"--inspect-brk",
11+
"${relativeFile}",
12+
],
13+
"console": "integratedTerminal",
14+
"internalConsoleOptions": "neverOpen",
15+
"port": 9229
16+
}]
17+
}

.vscode/settings.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"beautify.config": {
3+
"js": {
4+
"allowed_file_extensions": ["js", "jsonc", "jshintrc", "jsbeautifyrc"],
5+
"brace_style": "end-expand", // [collapse|expand|end-expand|none] Put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are
6+
"break_chained_methods": false, // Break chained method calls across subsequent lines
7+
"e4x": false, // Pass E4X xml literals through untouched
8+
"end_with_newline": true, // End output with newline
9+
"indent_char": " ", // Indentation character
10+
"indent_level": 0, // Initial indentation level
11+
"indent_size": 2, // Indentation size
12+
"indent_with_tabs": false, // Indent with tabs, overrides `indent_size` and `indent_char`
13+
"jslint_happy": false, // If true, then jslint-stricter mode is enforced
14+
"keep_array_indentation": false, // Preserve array indentation
15+
"keep_function_indentation": false, // Preserve function indentation
16+
"max_preserve_newlines": 0, // Maximum number of line breaks to be preserved in one chunk (0 disables)
17+
"preserve_newlines": true, // Whether existing line breaks should be preserved
18+
"space_after_anon_function": false, // Should the space before an anonymous function's parens be added, "function()" vs "function ()"
19+
"space_before_conditional": true, // Should the space before conditional statement be added, "if(true)" vs "if (true)"
20+
"space_in_empty_paren": false, // Add padding spaces within empty paren, "f()" vs "f( )"
21+
"space_in_paren": false, // Add padding spaces within paren, ie. f( a, b )
22+
"unescape_strings": false, // Should printable characters in strings encoded in \xNN notation be unescaped, "example" vs "\x65\x78\x61\x6d\x70\x6c\x65"
23+
"wrap_line_length": 0 // Lines should wrap at next opportunity after this number of characters (0 disables)
24+
},
25+
},
26+
"[javascript]": {
27+
"editor.defaultFormatter": "vscode.typescript-language-features"
28+
},
29+
"prettier.jsxSingleQuote": true,
30+
"prettier.singleQuote": true,
31+
"javascript.preferences.quoteStyle": "single",
32+
"files.insertFinalNewline": true,
33+
}

codegens/nodejs-axios/test/unit/snippet.test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,21 @@ describe('nodejs-axios convert function', function () {
424424
});
425425
});
426426

427+
it('should return snippet with maxBodyLength property set as "Infinity"', function () {
428+
request = new sdk.Request(mainCollection.item[0].request);
429+
options = {
430+
requestTimeout: 1000
431+
};
432+
convert(request, options, function (error, snippet) {
433+
if (error) {
434+
expect.fail(null, null, error);
435+
return;
436+
}
437+
expect(snippet).to.be.a('string');
438+
expect(snippet).to.include('maxBodyLength: Infinity');
439+
});
440+
});
441+
427442
describe('getOptions function', function () {
428443

429444
it('should return an array of specific options', function () {

test/codegen/newman/newmanTestUtil.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ function runSnippet (testConfig, snippets, collectionName) {
4444
it(item.name, function (done) {
4545
if (testConfig.fileName) {
4646
fs.writeFileSync(testConfig.fileName, codeSnippet);
47+
fs.writeFileSync(item.name.replaceAll('/', '-') + '.cs', codeSnippet);
4748
}
4849
// bash command string for compiling codeSnippet
4950
var compile = testConfig.compileScript ? testConfig.compileScript : null,

0 commit comments

Comments
 (0)