Skip to content

Commit

Permalink
datasource/index
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Jun 19, 2020
1 parent af81de4 commit 9868134
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
12 changes: 10 additions & 2 deletions lib/datasource/__snapshots__/index.spec.ts.snap
Expand Up @@ -3,14 +3,22 @@
exports[`datasource/index adds changelogUrl 1`] = `
Object {
"changelogUrl": "https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md",
"releases": Array [],
"releases": Array [
Object {
"version": "1.0.0",
},
],
"sourceUrl": "https://github.com/react-native-community/react-native-releases",
}
`;

exports[`datasource/index adds sourceUrl 1`] = `
Object {
"releases": Array [],
"releases": Array [
Object {
"version": "1.0.0",
},
],
"sourceUrl": "https://github.com/nodejs/node",
}
`;
12 changes: 8 additions & 4 deletions lib/datasource/index.spec.ts
Expand Up @@ -76,7 +76,9 @@ describe('datasource/index', () => {
).toBeUndefined();
});
it('adds changelogUrl', async () => {
npmDatasource.getReleases.mockResolvedValue({ releases: [] });
npmDatasource.getReleases.mockResolvedValue({
releases: [{ version: '1.0.0' }],
});
const res = await datasource.getPkgReleases({
datasource: datasourceNpm.id,
depName: 'react-native',
Expand All @@ -86,7 +88,9 @@ describe('datasource/index', () => {
expect(res.sourceUrl).toBeDefined();
});
it('adds sourceUrl', async () => {
npmDatasource.getReleases.mockResolvedValue({ releases: [] });
npmDatasource.getReleases.mockResolvedValue({
releases: [{ version: '1.0.0' }],
});
const res = await datasource.getPkgReleases({
datasource: datasourceNpm.id,
depName: 'node',
Expand All @@ -97,7 +101,7 @@ describe('datasource/index', () => {
it('trims sourceUrl', async () => {
npmDatasource.getReleases.mockResolvedValue({
sourceUrl: ' https://abc.com',
releases: [],
releases: [{ version: '1.0.0' }],
});
const res = await datasource.getPkgReleases({
datasource: datasourceNpm.id,
Expand All @@ -108,7 +112,7 @@ describe('datasource/index', () => {
it('massages sourceUrl', async () => {
npmDatasource.getReleases.mockResolvedValue({
sourceUrl: 'scm:git@github.com:Jasig/cas.git',
releases: [],
releases: [{ version: '1.0.0' }],
});
const res = await datasource.getPkgReleases({
datasource: datasourceNpm.id,
Expand Down

0 comments on commit 9868134

Please sign in to comment.