Skip to content

Commit

Permalink
add error code and response
Browse files Browse the repository at this point in the history
  • Loading branch information
N-give committed Apr 8, 2022
1 parent fc91577 commit 45640fb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions test/get.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,16 @@ for (const connection of <const>['ws', 'http']) {
t.assert(putResp.headers['content-location']);
t.assert(putResp.headers['x-oada-rev']);

await t.throwsAsync(getAxios(
await t.throwsAsync(
getAxios(
`/bookmarks/${testName}/sometest4`,
{ 'X-OADA-Ensure-Link': 'versioned' }
));
),
{
code: '400',
message: 'X-OADA-Ensure-Link not allowed for this method',
}
);
});

test(`${connection}: Should allow you to get resources based on a tree`, async (t) => {
Expand Down
10 changes: 8 additions & 2 deletions test/put.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,17 @@ for (const connection of <const>['ws', 'http']) {

test(`${connection}: Should error when 'X-OADA-Ensure-Link' contains an unsupported value`, async (t) => {
const { testName } = t.context as Context;
await t.throwsAsync(putAxios(
await t.throwsAsync(
putAxios(
{ somedata: 456 },
`/bookmarks/${testName}/sometest4`,
{ 'X-OADA-Ensure-Link': 'unsupportedValue' }
));
),
{
code: '400',
message: 'Unsupported value for X-OADA-Ensure-Link',
}
);
});

test(`${connection}: Should create the proper resource breaks on the server when a tree parameter is supplied to a deep endpoint`, async (t) => {
Expand Down

0 comments on commit 45640fb

Please sign in to comment.