forked from OctoLinker/OctoLinker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust resolvers to return a single string or an array of strings whe…
…never possible (OctoLinker#476)
- Loading branch information
1 parent
223984b
commit 5d4edbd
Showing
14 changed files
with
44 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,35 @@ | ||
import assert from 'assert'; | ||
import dockerImage from '../index'; | ||
|
||
describe('docker-image', () => { | ||
const path = '/blob/path/dummy'; | ||
|
||
it('resolves foo to https://hub.docker.com/_/foo', () => { | ||
assert.deepEqual(dockerImage.resolve(path, ['foo']), [ | ||
expect(dockerImage.resolve(path, ['foo'])).toBe( | ||
'https://hub.docker.com/_/foo', | ||
]); | ||
); | ||
}); | ||
|
||
it('resolves foo:1.2.3 to https://hub.docker.com/_/foo', () => { | ||
assert.deepEqual(dockerImage.resolve(path, ['foo:1.2.3']), [ | ||
expect(dockerImage.resolve(path, ['foo:1.2.3'])).toBe( | ||
'https://hub.docker.com/_/foo', | ||
]); | ||
); | ||
}); | ||
|
||
it('resolves foo:1.2.3-alpha to https://hub.docker.com/_/foo', () => { | ||
assert.deepEqual(dockerImage.resolve(path, ['foo:1.2.3-alpha']), [ | ||
expect(dockerImage.resolve(path, ['foo:1.2.3-alpha'])).toBe( | ||
'https://hub.docker.com/_/foo', | ||
]); | ||
); | ||
}); | ||
|
||
it('resolves foo/bar to https://hub.docker.com/r/foo/bar', () => { | ||
assert.deepEqual(dockerImage.resolve(path, ['foo/bar']), [ | ||
expect(dockerImage.resolve(path, ['foo/bar'])).toBe( | ||
'https://hub.docker.com/r/foo/bar', | ||
]); | ||
); | ||
}); | ||
|
||
it('resolves foo/bar:1.2.3 to https://hub.docker.com/r/foo/bar', () => { | ||
assert.deepEqual(dockerImage.resolve(path, ['foo/bar:1.2.3']), [ | ||
expect(dockerImage.resolve(path, ['foo/bar:1.2.3'])).toBe( | ||
'https://hub.docker.com/r/foo/bar', | ||
]); | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
import assert from 'assert'; | ||
import dotNetCore from '../index'; | ||
|
||
describe('dotNetCore', () => { | ||
const path = '/blob/path/dummy'; | ||
|
||
it('resolves Microsoft.NETCore.App to https://www.nuget.org/packages/Microsoft.NETCore.App', () => { | ||
assert.deepEqual(dotNetCore.resolve(path, ['Microsoft.NETCore.App']), [ | ||
expect(dotNetCore.resolve(path, ['Microsoft.NETCore.App'])).toBe( | ||
'https://www.nuget.org/packages/Microsoft.NETCore.App', | ||
]); | ||
); | ||
}); | ||
|
||
it('resolves Microsoft.Extensions.Configuration.FileExtensions to https://www.nuget.org/packages/Microsoft.Extensions.Configuration.FileExtensions', () => { | ||
assert.deepEqual( | ||
expect( | ||
dotNetCore.resolve(path, [ | ||
'Microsoft.Extensions.Configuration.FileExtensions', | ||
]), | ||
[ | ||
'https://www.nuget.org/packages/Microsoft.Extensions.Configuration.FileExtensions', | ||
], | ||
).toBe( | ||
'https://www.nuget.org/packages/Microsoft.Extensions.Configuration.FileExtensions', | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
import assert from 'assert'; | ||
import dotNet from '../index'; | ||
|
||
describe('dotNet', () => { | ||
const path = '/blob/path/dummy'; | ||
|
||
it('resolves EntityFramework to https://www.nuget.org/packages/EntityFramework', () => { | ||
assert.deepEqual(dotNet.resolve(path, ['EntityFramework']), [ | ||
expect(dotNet.resolve(path, ['EntityFramework'])).toBe( | ||
'https://www.nuget.org/packages/EntityFramework', | ||
]); | ||
); | ||
}); | ||
|
||
it('resolves Stanford.NLP.CoreNLP to https://www.nuget.org/packages/Stanford.NLP.CoreNLP', () => { | ||
assert.deepEqual(dotNet.resolve(path, ['Stanford.NLP.CoreNLP']), [ | ||
expect(dotNet.resolve(path, ['Stanford.NLP.CoreNLP'])).toBe( | ||
'https://www.nuget.org/packages/Stanford.NLP.CoreNLP', | ||
]); | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
import assert from 'assert'; | ||
import rustCrate from '../index'; | ||
|
||
describe('rust-crate', () => { | ||
const path = '/blob/path/dummy'; | ||
|
||
it('resolves hamcrest using the live-resolver', () => { | ||
assert.deepEqual(rustCrate.resolve(path, ['hamcrest']), { | ||
url: 'https://githublinker.herokuapp.com/q/crates/hamcrest', | ||
method: 'GET', | ||
}); | ||
expect(rustCrate.resolve(path, ['hamcrest'])).toBe( | ||
'https://githublinker.herokuapp.com/q/crates/hamcrest', | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
export default function({ type, target }) { | ||
return { | ||
url: `https://githublinker.herokuapp.com/q/${type}/${target}`, | ||
method: 'GET', | ||
}; | ||
return `https://githublinker.herokuapp.com/q/${type}/${target}`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default function({ target }) { | ||
return [`https://www.nuget.org/packages/${target}`]; | ||
return `https://www.nuget.org/packages/${target}`; | ||
} |