question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Discussion about some features

See original GitHub issue

Ping @netmilk

I think that dredd is a really cool product, and I would like to use it for pretty much every api that I build from now on. However, there is a few things that I don’t know how to best accomplish in dredd at the moment and that is what I would like to open a discussion on.

I have a quick and dirty implementation of what I want in LinusU/mocha-api-blueprint, don’t be fooled by the mocha in the name, that is only a minor part.

I have also created an example of how it is used at LinusU/mocha-api-blueprint-example. This is the beautiful specifications and the strict testing that I want to accomplish.

The first thing that I would like to mention is the response body. I’ve added a feature where I can specify the value as {variableName} and have it accept any value and store it for later. As you can see this makes it possible to test that I can make a POST request and then GET that same resource back.

This also allows me to use assert.deepEqual() for testing the values instead of guessing a JSON-schema for the response. It will make sure that the api actually stores the correct values.

The parameters in the uriTemplates will now fetch the previously stored value if applicable. Please run the tests in mocha-api-blueprint-example to see this in action. The api will return random ids every time but yet it will work beautifully.

That was the most important feature, but I have also integrated very tightly with mocha and I think it would be great if it was very easy to integrate into any existing test frameworks. I think that this would lower the barrier for other people to start using dredd, since it would fit right into their existing setup.

I think that a nice way of doing this is to expose all the transactions that needs to be run to the user, divided by category, and then let the user run them and return the response. This also ties in with the next thing; letting the user send the requests.

Now, I think that this part should be optional; but I think it’s brilliant to let the user run the transaction and return the result, instead of having lots of hooks. It gives the user the most control, and it makes for cleaner code.

We could just have a default handler that does the normal thing.

I realize that this is a lot of very brave changes but what I really want to have is a discussion where we can see how much of this would be feasible to have in dredd, and how much that I should keep outside.

It’s really two issues, the one that allows multiple and stricter tests, and the one that allows tighter integration with existing test frameworks.

Happy coding 🍻

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
honzajavorekcommented, Mar 8, 2017

@netmilk @LinusU Feel free to re-open or get to a new issue with more ideas! Closing this now for inactivity.

0reactions
honzajavorekcommented, Mar 14, 2016

@netmilk @LinusU Any updates on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

11 Powerful Features You Should Have in Your Online ...
Customer discussion forums connect customers with one another and lower support costs. Check out these 11 features to create discussion ...
Read more >
Guiding Students Through Expository Text with Text Feature ...
As a group, discuss any predictions, questions, and connections you have based on the text feature and discuss how you think it will...
Read more >
Discussion Section for Research Papers
The discussion section is one of the final parts of a research paper, in which an author describes, analyzes, and interprets their findings....
Read more >
99 Mindful Conversation Topics For Deeper Connections
Mindful conversation topics are a wonderful way to deepen relationships or foster meaningful discussions with friends, family, co-workers, ...
Read more >
Characteristics of the Discussion in Online and Face-to-Face ...
The present study was conducted to reveal differences in the characteristics of focus group discussions in the online and face-to-face formats. Participants in ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found