fix parseHydraDocumentation.test#34
Conversation
| expect(data).toHaveProperty("response"); | ||
| expect(data).toHaveProperty("status"); | ||
| }); | ||
| let expectedError; |
There was a problem hiding this comment.
To avoid issue, can you initialize "expectedError.message"?
For example:
const expectedError = { message: '' }| expect(data).toHaveProperty("response"); | ||
| expect(data).toHaveProperty("status"); | ||
| }); | ||
| let expectedError; |
There was a problem hiding this comment.
To avoid issue, can you initialize "expectedError.message"?
For example:
const expectedError = { message: '' }| parseHydraDocumentation("http://localhost/").catch(data => { | ||
| expect(data.message).toBe('The API entrypoint has no "@type" key.'); | ||
| }); | ||
| let expectedError; |
There was a problem hiding this comment.
To avoid issue, can you initialize "expectedError.message"?
For example:
const expectedError = { message: '' }| 'The API documentation has no "http://www.w3.org/ns/hydra/core#supportedClass" key or its value is not an array.' | ||
| ); | ||
| }); | ||
| let expectedError; |
There was a problem hiding this comment.
To avoid issue, can you initialize "expectedError.message"?
For example:
const expectedError = { message: '' }| 'The entrypoint definition has no "http://www.w3.org/ns/hydra/core#supportedProperty" key or it is not an array.' | ||
| ); | ||
| }); | ||
| let expectedError; |
There was a problem hiding this comment.
To avoid issue, can you initialize "expectedError.message"?
For example:
const expectedError = { message: '' }| expect(data).toHaveProperty("response"); | ||
| expect(data).toHaveProperty("status"); | ||
| }); | ||
| const expectedError = {}; |
There was a problem hiding this comment.
@mauchede : For this test, expectedError should be an empty object ?
There was a problem hiding this comment.
Indeed, an empty object should be better.
| try { | ||
| await parseHydraDocumentation("http://localhost/"); | ||
| } catch (error) { | ||
| expectedError.api = error.api; |
There was a problem hiding this comment.
Change the value of expectedError: it will be easier than create new properties.
expectedError = error| expect(data).toHaveProperty("response"); | ||
| expect(data).toHaveProperty("status"); | ||
| }); | ||
| const expectedError = {}; |
There was a problem hiding this comment.
Indeed, an empty object should be better.
| try { | ||
| await parseHydraDocumentation("http://localhost/"); | ||
| } catch (error) { | ||
| expectedError.api = error.api; |
There was a problem hiding this comment.
Change the value of expectedError: it will be easier than create new properties.
expectedError = error| test("Invalid entrypoint JSON", () => { | ||
| const entrypoint = `{foo,}`; | ||
| test("Invalid entrypoint JSON", async () => { | ||
| let entrypoint = `{foo,}`; |
There was a problem hiding this comment.
Why did you use backquote here?
There was a problem hiding this comment.
I did not change the format, but i think this is suppose to be a JSON string, not a JS Object ? (Like the const entrypoint)
There was a problem hiding this comment.
OK, I did not see than you "only" change const to let. Why did you change it (I did not see another assignation of entrypoint in the test)?
There was a problem hiding this comment.
To gain speed because it's one letter less 😄
(Can't remember why, i just rechanged it)
mauchede
left a comment
There was a problem hiding this comment.
LGTM! Can you squash your commit? I will merge your PR after squashing.
|
Commits squashed ! |
|
Nice work @jfthuillier! |
No description provided.