Skip to content

Commit d68370d

Browse files
committed
Add test for translating JSON.parse(responseBody) without assignment in legacy Postman API
1 parent 9c505e1 commit d68370d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/bruno-converters/tests/postman/postman-translations/transpiler-tests/legacy-global-apis.test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,19 @@ describe('Legacy Postman API Translation', () => {
5252
expect(result).not.toContain('responseBody');
5353
});
5454

55+
test('should translate JSON.parse(responseBody) usage without assignment when no user variables exist', () => {
56+
const input = `
57+
console.log(JSON.parse(responseBody));
58+
`;
59+
60+
const result = translateCode(input);
61+
const expected = `
62+
console.log(res.getBody());
63+
`;
64+
65+
expect(result).toContain(expected);
66+
});
67+
5568
test('should translate all legacy APIs when no conflicts exist', () => {
5669
const input = `
5770
const data = JSON.parse(responseBody);

0 commit comments

Comments
 (0)