talis-fb / TReq

A CLI tool for effortless HTTP requests
GNU General Public License v3.0
50 stars 3 forks source link

Add Feature `rename` #12 #17

Closed SummerGram closed 7 months ago

SummerGram commented 7 months ago

This is for the rename feature!

talis-fb commented 7 months ago

@SummerGram did you run cargo test? The error of pipeline coming from basic integration tests of code. You can fix it just fixing the MockAppBackend in tests/mocks/repositories/mod.rs. It's really easy to fix, just call the default method following exactly as all the other methods in this implementation.

SummerGram commented 7 months ago

btw, I found that there are some typo in the code. Do I require to create new issue and have a PR for that?

SummerGram commented 7 months ago

@talis-fb Please have a look!

talis-fb commented 7 months ago

btw, I found that there are some typo in the code. Do I require to create new issue and have a PR for that?

You can fix them in this PR! No problemn

talis-fb commented 7 months ago

@SummerGram are you going to fix the Typo?? If yes, please add a e2e test for your modification too. In tests/e2e/basic.rs. This is the last thing that would be nice to add. If not I can add later. But I've already did the test to add there. You can just paste it.

#[test]
fn should_rename_requests() {
    // Setup
    let input = format!("treq GET {}/get --save-as request-to-be-renamed", host());
    let mut cmd = run_cmd(&input);
    cmd.assert().success();

    // Before rename
    let input = "treq run request-to-be-renamed";
    let mut cmd = run_cmd(&input);
    cmd.assert().success();
    let input = "treq run request-renamed";
    let mut cmd = run_cmd(&input);
    cmd.assert().failure();

    let input = "treq rename request-to-be-renamed request-renamed --no-confirm";
    let mut cmd = run_cmd(&input);
    cmd.assert().success();

    // After rename
    let input = "treq run request-to-be-renamed";
    let mut cmd = run_cmd(&input);
    cmd.assert().failure();
    let input = "treq run request-renamed";
    let mut cmd = run_cmd(&input);
    cmd.assert().success();
}
talis-fb commented 7 months ago

If you like you can add some other tests case. It would be awesome. But this one is the sufficient

SummerGram commented 7 months ago

@talis-fb

When will it be merged?

talis-fb commented 7 months ago

@talis-fb

When will it be merged?

@SummerGram, now. I was just waiting you confirm if you'd up the typo and test.

Really great job! Very thanks for your contribution! 🤩

SummerGram commented 7 months ago

@talis-fb

I fix the typo and add the test.

Btw, what is the roadmap and the goal of this repo?

talis-fb commented 7 months ago

@SummerGram

Good question! I really need to put this in somewhere in the repo, I'm working on it.

Basically the repo trying to be a improvement of HTTPie (and all Cli HTTP Clients) with focus on persistent requests and ways to manipulate them easier in terminal. A tool to bring the way we work with GUI app like Insomnia to terminal. Instead just do a "quick requests" (like the workflow of httpie and curl like apps) you have a "collection" of requests with saved body and params, and them you can submit them just changing a couple of field with a little command. I'd say the goal of TReq is be a terminal tool to make the users do not feel the needing to use GUI app when testing APIs, due to some missing features CLI tools do not provide.

For now, the priority is really implement all the "must have" features. The foundation of HTTPie interface. So, for now, we really does not have any differential except the saved requests. But in the future the ideia is focus in

SummerGram commented 7 months ago

@talis-fb

honestly, I only use CLI app like curl and wget. For the GUI, I used postman before.

Do you try to outperform them? Not sure if it can outperform curl.

talis-fb commented 7 months ago

@SummerGram What do you mean with "outperform"??

SummerGram commented 7 months ago

@talis-fb

I mean the performance of treq commands is better than other CLI app similar commands