-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace preq with api-testing REST client #1281
base: master
Are you sure you want to change the base?
Replace preq with api-testing REST client #1281
Conversation
Bug: T265846
@@ -15,123 +16,108 @@ describe('transform api', function() { | |||
this.timeout(20000); | |||
let contentTypes; | |||
const server = new Server(); | |||
const client = new REST(''); |
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.
Nothing to do here in this pull request, but it would've been sweet if we could inject the config into the clients @clarakosi
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.
So the current workaround for the JSON file would be to declare an environment variable for the base URI. Probably easiest to do it in the test command in package.json but that would complicate things when trying to run a single file. Will look into why we did it this way next week
Can you add the changes you made for these tests into the PR too? It's hard to debug not knowing what you've done. |
I've tried to change this one locally and it works for me.
So, this one requires you to set a
So I've attempted to just use |
Bug: T265846
The two tests that are failing have been added into the PR. Hope we can find a way to make them work with the |
Bug: T265846
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've updated the api-testing package to address some of the issues you were having. You can find the new changes in api-testing 1.4.0
Bug: T265846
@clarakosi and @Pchelolo, all instances of |
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.
Well done! 🎉 One more nit below
Bug: T265846
f32444a
to
0d28434
Compare
Bug: T265846
Bug: T265846
I have been able to replace
preq
with theapi-testing
RESTclient
within 11 out of 13 tests.The two tests that are failing when I switch them to
client.post
are;The
html2wt with scrub_wikitext
test fails with error 400 whenever thescrub_wikitext: 1
parameter is added.The
supports stashing content
test fails at the secondclient.post
.Could there be something I am missing that is causing these two tests to fail?