Skip to content

Commit

Permalink
Explain test format
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Jun 24, 2017
1 parent 10b4255 commit 70faec9
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ function urlMatcherMacro(t, locations, shouldMatch = []) {
}
}

// URLs are made up, but theirstructure must be real.
// Some URLs may be skipped with `false` if they require complex code changes.
test(urlMatcherMacro, [
// Tests are done using each of these as the currentUrl
const supportedDomains = [
'https://github.com/bfred-it/shorten-repo-url/issue/1',
'https://gitlab.com/bfred-it/shorten-repo-url/issue/1',
], [
];

// URLs are made up, but theirstructure must be real.
// Some URLs may be skipped with `false` if they require complex code changes.
// Format is [expected, domain1url, ..., domainNurl]
const expectedPairs = [
[
'bfred-it/shorten-repo-url',
'https://github.com/bfred-it/shorten-repo-url/',
Expand Down Expand Up @@ -447,4 +451,6 @@ test(urlMatcherMacro, [
'https://example.com/nodejs/node/blob/cc8fc46/.gitignore',
'https://example.com/nodejs/node/blob/cc8fc46/.gitignore',
],
]);
];

test(urlMatcherMacro, supportedDomains, expectedPairs);

0 comments on commit 70faec9

Please sign in to comment.