added unit tests
This commit is contained in:
@@ -6,7 +6,7 @@ describe("utils", () => {
|
|||||||
let matcher
|
let matcher
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
matcher = createMatcher(remoteServices)
|
matcher = createMatcher(remoteServices, {})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("createMatcher", () => {
|
describe("createMatcher", () => {
|
||||||
@@ -162,4 +162,27 @@ describe("utils", () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe("urlMatcher with overrideHosts", () => {
|
||||||
|
let matcher
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
matcher = createMatcher(remoteServices, {
|
||||||
|
github: "https://my-custom-github-url.com",
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe("createMatcher", () => {
|
||||||
|
it("matches overridden host and path", () => {
|
||||||
|
const service = matcher("https://my-custom-github-url.com/hundertzehn/mocoapp/pull/123")
|
||||||
|
expect(service.key).toEqual("github-pr")
|
||||||
|
expect(service.name).toEqual("github")
|
||||||
|
})
|
||||||
|
|
||||||
|
it("doesn't match default host and path", () => {
|
||||||
|
const service = matcher("https://github.com/hundertzehn/mocoapp/pull/123")
|
||||||
|
expect(service).toBe(undefined)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user