Fix bug where you weren't able to use both the -q and -j flags at the same time #227

Merged
Vylpes merged 17 commits from feature/181-q-json-flags into develop 2024-12-07 22:21:43 +00:00
Owner
  • Fix bug where if you supplied both -q/--query-metadata and -j/--json the query metadata wasn't added to the output
  • Update tests

#181

- Fix bug where if you supplied both `-q`/`--query-metadata` and `-j`/`--json` the query metadata wasn't added to the output - Update tests #181
Vylpes added 3 commits 2024-09-15 11:56:43 +01:00
Plan tests
All checks were successful
Test / build (push) Successful in 9s
ebf270f2bb
Update tests
All checks were successful
Test / build (push) Successful in 9s
bf026dae32
Vylpes requested review from VylpesTester 2024-09-15 11:56:47 +01:00
Vylpes added the
type
bug
label 2024-09-15 11:56:51 +01:00
VylpesTester was assigned by Vylpes 2024-09-15 11:56:53 +01:00
VylpesTester requested changes 2024-09-15 16:19:28 +01:00
Dismissed
@ -8,6 +8,15 @@ export default class OutputHelper {
const outputLines: string[] = [];
if (options.json) {
if (options.queryMetadata != null) {
Member

I feel like there could be a better way to do this? As now we have the output kinda splintered. I suggest maybe we have the json object created in a separate function, and then split to human-readable if -j isn't present

I feel like there could be a better way to do this? As now we have the output kinda splintered. I suggest maybe we have the json object created in a separate function, and then split to human-readable if `-j` isn't present
Vylpes marked this conversation as resolved
Vylpes added 3 commits 2024-10-18 18:58:03 +01:00
Vylpes added 1 commit 2024-10-18 19:12:20 +01:00
New line the return statement
All checks were successful
Test / build (push) Successful in 8s
3b284484c2
Vylpes added 1 commit 2024-10-18 19:27:36 +01:00
Make object flat
Some checks failed
Test / build (push) Failing after 9s
438884b270
Vylpes added 1 commit 2024-10-18 19:28:21 +01:00
Fix linting
All checks were successful
Test / build (push) Successful in 8s
eb09754e2e
VylpesTester requested changes 2024-10-19 20:35:23 +01:00
Dismissed
@ -33,0 +25,4 @@
let output = "";
for (const key in object) {
output += `${key} = ${object[key]}\n`;
Member

This will add an additional new line at the end of the output which might not look right

This will add an additional new line at the end of the output which might not look right
Vylpes marked this conversation as resolved
Vylpes added 2 commits 2024-10-26 20:52:50 +01:00
Vylpes requested review from VylpesTester 2024-10-26 20:53:03 +01:00
VylpesTester reviewed 2024-10-26 21:58:46 +01:00
@ -33,0 +22,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
private static GetFriendlyObjectText(object: any): string {
const output: string[] = [];
Member

I don't think I like the way this is done, I think it should be how it was before, but when its actually printed to the terminal it should remove the appended new line

I don't think I like the way this is done, I think it should be how it was before, but when its actually printed to the terminal it should remove the appended new line
Author
Owner

Not exactly sure what this means? It appears to be working fine and looks like that to me

Not exactly sure what this means? It appears to be working fine and looks like that to me
Vylpes marked this conversation as resolved
VylpesTester requested changes 2024-10-26 21:59:08 +01:00
Dismissed
VylpesTester left a comment
Member

See above

See above
Copilot reviewed 2024-11-18 20:50:30 +00:00
Vylpes requested review from Copilot 2024-11-18 20:51:07 +00:00
Copilot reviewed 2024-11-18 20:51:40 +00:00
@ -32,1 +21,4 @@
}
/* eslint-disable @typescript-eslint/no-explicit-any */
private static GetFriendlyObjectText(object: any): string {
Member

[nitpick] The use of 'any' for the object parameter is not ideal. Consider using a more specific type.

[nitpick] The use of 'any' for the object parameter is not ideal. Consider using a more specific type.
Vylpes marked this conversation as resolved
Vylpes removed review request for Copilot 2024-11-18 20:51:52 +00:00
Vylpes added 1 commit 2024-11-27 18:34:49 +00:00
Use a generic instead of an any object
All checks were successful
Test / build (push) Successful in 9s
3e4c3d502a
Member

Copilot reviewed 3 out of 3 changed files in this pull request and generated no suggestions.

Copilot reviewed 3 out of 3 changed files in this pull request and generated no suggestions.
Vylpes requested review from VylpesTester 2024-11-27 18:37:13 +00:00
Vylpes added 2 commits 2024-11-27 18:40:16 +00:00
Fix tests
All checks were successful
Test / build (push) Successful in 9s
52df3e843e
Vylpes added 1 commit 2024-12-02 17:57:05 +00:00
Merge branch 'develop' into feature/181-q-json-flags
All checks were successful
Test / build (push) Successful in 8s
922bcde4ba
VylpesTester requested changes 2024-12-02 18:02:06 +00:00
Dismissed
@ -106,7 +106,7 @@ describe("GenerateOutput", () => {
expect(result).toMatchSnapshot();
});
test("GIVEN the Gallery input has more than 1 item, EXPECT Gallery line to be added", () => {
Member

Why don't we want this test anymore? Surely thats still a good thing to test?

Why don't we want this test anymore? Surely thats still a good thing to test?
Vylpes marked this conversation as resolved
Vylpes added 2 commits 2024-12-04 18:29:15 +00:00
Vylpes requested review from VylpesTester 2024-12-04 18:29:56 +00:00
VylpesTester approved these changes 2024-12-07 22:21:28 +00:00
Vylpes merged commit 3b2da358b3 into develop 2024-12-07 22:21:43 +00:00
Vylpes deleted branch feature/181-q-json-flags 2024-12-07 22:21:43 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: RabbitLabs/random-bunny#227
No description provided.