Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit 7344f12

Browse files
fix: validates relative URI
1 parent f08d0a6 commit 7344f12

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/next/test/unit/units/validateURI.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ describe('validateURI', () => {
55
describe('given matching URI', () => {
66
const result = validateURI(
77
{
8-
uri: 'https://apiary.io/dashboard'
8+
uri: '/dashboard'
99
},
1010
{
11-
uri: 'https://apiary.io/dashboard'
11+
uri: '/dashboard'
1212
}
1313
);
1414

@@ -36,10 +36,10 @@ describe('validateURI', () => {
3636
describe('given non-matching URI', () => {
3737
const result = validateURI(
3838
{
39-
uri: 'https://apiary.io/dashboard'
39+
uri: '/dashboard'
4040
},
4141
{
42-
uri: 'http://domain.com/dashboard'
42+
uri: '/profile'
4343
}
4444
);
4545

@@ -68,7 +68,7 @@ describe('validateURI', () => {
6868
assert.propertyVal(
6969
result.errors[0],
7070
'message',
71-
'Expected "uri" field to equal "https://apiary.io/dashboard", but got "http://domain.com/dashboard".'
71+
'Expected "uri" field to equal "/dashboard", but got "/profile".'
7272
);
7373
});
7474
});

lib/next/units/validateStatusCode.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function validateStatusCode(expected, real) {
2222
validator: 'TextDiff',
2323
realType: APIARY_STATUS_CODE_TYPE,
2424
expectedType: APIARY_STATUS_CODE_TYPE,
25+
rawData: '',
2526
errors
2627
};
2728
}

0 commit comments

Comments
 (0)