-
Notifications
You must be signed in to change notification settings - Fork 22
Conversation
CI requires next |
I'm wondering whether it wouldn't help if we had those two in one repo 🤔 |
@honzajavorek it's troublesome that spec lives its own life, yet wasn't that the original intent? So that there could be multiple implementations of gavel? I would say we need to assess if that's useful, and how many Gavel implementations in other languages we have. If the effort is not worth a trouble, I would vote for moving |
Yes, it was. I guess we could solve it for once when we have Dredd monorepo where all these things can live, together and separated at the same time.
After 6 years of gavel.js existence we still have just gavel.js. The strategy did work out for dredd hooks, but not for gavel. It seems there is no audience to it, people want to use gavel as a core of other tools, not to use it separately. You can see the hopes were different - there's gavel-spec, and there's gavel CLI. I'm not sure how many people use the CLI, TBH, gavel as an end product has never took off. |
3d3a2a3
to
9b8a0a0
Compare
As of 71a02bc, gavel.js is compliant with the next version of Roadmap
|
Updated Previously, code snippets described in features were compared to the parsed HTTP message (parsing done as a part of
On their own those classes did absolutely nothing to perform the parsing, or affect a provided HTTP message (I omit partial normalization during the validation because this is not what Since aforementioned classes have been removed from the library's public API, test setup cannot rely on dynamic class instantiation anymore: const foo = gavel[klass](data) Also, since I do, however, find this test useless, as it doesn't involve testing actual library's API, and looks like test for the sake of test. I would vote for removing it, which means removing |
81d9dc8
to
cbf0b5a
Compare
Updated to the latest release of |
Regarding #178 (comment), I think the only benefit left is documenting how over-the-wire HTTP messages map to Gavel input. If we have proper docs about how to run Gavel and how to structure its inputs, I think it is okay to remove the feature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (string === 'true') return true; | ||
if (string === 'false') return false; | ||
return !!string; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think JSON.parse('false')
produces false and JSON.parse('true')
produces true. Perhaps we could use it instead, for a simplicity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would this work if the string
is "abc"
?
Calling JSON.parse('abc')
will throw, and if the JSON.parse(string)
is positioned below the !!string
it's rendered useless. Maybe I'm not fully understanding what you meant...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to reply with more context, but then I got stuck not being able to find toBoolean()
used. Where is it being called? I couldn't find toCamelCase()
or toPascalCase()
either.
I agree. Data models bear informative value, but they weren't asserting anything in the public's API. As discussed with @kylef, I also voted to include this models in the documentation for general knowledge, but remove from tests. |
I wonder, would @honzajavorek what do you think about this? |
query: parseQueryString(queryString) | ||
pathname, | ||
port, | ||
hash, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accounting for previously missing hash
in the URI.
BREAKING CHANGE: Gavel no longer exposes "isValidatable" method in its public API
BREAKING CHANGE: Gavel no longer exports "isValid" method from public API. Pleae use "gavel.validate" instead.
BREAKING CHANGE: Calling "gavel.validate" no longer requires the "type" parameter.
BREAKING CHANGE: Gavel no longer exports "HttpRequest" and "HttpResponse" classes. Use "validate" instead.
BREAKING CHANGE: Gavel's call signature of the "validate" function is now the following: validate(expected, real)
BREAKING CHANGE: "gavel.validate()" no longer accepts a callback as an argument. Please use the "validate()" function as follows: const result = gavel.validate(expected, real)
🎉 This PR is included in version 6.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I think #178 (comment) is a good point. I'm not sure about the consequences. If relative URLs are an issue my idea was to work around it with prefixing it with |
These changes implement the next major version of Gavel per defined spec. They must be merged once the spec lands.
Refs
Changelog
Roadmap
uri
feature, implement if decided