Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-atr committed Oct 21, 2022
1 parent 2959639 commit 1a0d9c5
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/helpers/fetch-utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ const URL2 = 'http://example.com';
const URL3 = '/^https?://example.org/';
const URL4 = '/^https?://example.org/section#user:45/comments/';

test('Test different url props, simple input', (assert) => {
assert.ok(parseMatchProps(URL1).url, URL1, 'No url match prop, no protocol, not regexp');
assert.ok(parseMatchProps(`url:${URL1}`).url, URL1, 'url match prop, no protocol, not regexp');
test('Test parseMatchProps with different url props, simple input', (assert) => {
assert.strictEqual(parseMatchProps(URL1).url, URL1, 'No url match prop, no protocol, not regexp');
assert.strictEqual(parseMatchProps(`url:${URL1}`).url, URL1, 'url match prop, no protocol, not regexp');

assert.ok(parseMatchProps(URL2).url, URL2, 'No url match prop, has protocol, not regexp');
assert.ok(parseMatchProps(`url:${URL2}`).url, URL2, 'url match prop, has protocol, not regexp');
assert.strictEqual(parseMatchProps(URL2).url, URL2, 'No url match prop, has protocol, not regexp');
assert.strictEqual(parseMatchProps(`url:${URL2}`).url, URL2, 'url match prop, has protocol, not regexp');

assert.ok(parseMatchProps(URL3).url, URL3, 'No url match prop, has protocol, regexp');
assert.ok(parseMatchProps(`url:${URL3}`).url, URL3, 'url match prop, has protocol, regexp');
assert.strictEqual(parseMatchProps(URL3).url, URL3, 'No url match prop, has protocol, regexp');
assert.strictEqual(parseMatchProps(`url:${URL3}`).url, URL3, 'url match prop, has protocol, regexp');

assert.ok(parseMatchProps(URL4).url, URL4, 'No url match prop, has protocol, regexp, extra colon in url');
assert.ok(parseMatchProps(`url:${URL4}`).url, URL4, 'url match prop, has protocol, extra colon in url');
assert.strictEqual(parseMatchProps(URL4).url, URL4, 'No url match prop, has protocol, regexp, extra colon in url');
assert.strictEqual(parseMatchProps(`url:${URL4}`).url, URL4, 'url match prop, has protocol, extra colon in url');
});

test('Test different url props, mixed input', (assert) => {
test('Test parseMatchProps with different url props, mixed input', (assert) => {
const INPUT1 = `${URL1} ${METHOD_PROP}:${GET_METHOD}`;
const expected1 = {
url: URL1,
Expand Down

0 comments on commit 1a0d9c5

Please sign in to comment.