diff --git a/test/api/github.spec.js b/test/api/github.spec.js index 494e58569942a8774f813085913c015842f71338..de08142728cea576378d7a9ec3598b6714d66f6e 100644 --- a/test/api/github.spec.js +++ b/test/api/github.spec.js @@ -204,6 +204,28 @@ describe('api/github', () => { expect(pr).toMatchSnapshot(); }); }); + describe('getBranchStatus(branchName)', () => { + it('should return true', async () => { + await initRepo('some/repo', 'token'); + ghGot.mockImplementationOnce(() => ({ + body: { + state: true, + }, + })); + const res = await github.getBranchStatus('somebranch'); + expect(res).toEqual(true); + }); + it('should return false', async () => { + await initRepo('some/repo', 'token'); + ghGot.mockImplementationOnce(() => ({ + body: { + state: false, + }, + })); + const res = await github.getBranchStatus('somebranch'); + expect(res).toEqual(false); + }); + }); describe('addAssignees(issueNo, assignees)', () => { it('should add the given assignees to the issue', async () => { await initRepo('some/repo', 'token'); diff --git a/test/helpers/versions.spec.js b/test/helpers/versions.spec.js index b3e0df1f7849fd995871ce9a1682370ce5836ac4..d370f31e450b78d11bea457672cf80cc395f4627 100644 --- a/test/helpers/versions.spec.js +++ b/test/helpers/versions.spec.js @@ -290,6 +290,10 @@ describe('helpers/versions', () => { const config = Object.assign({}, defaultConfig, { pinVersions: false }); expect(versionsHelper.determineUpgrades(qJson, '<= 0.7.2', config)).toEqual(upgradeVersions); }); + it('rejects less than ranges without pinning', () => { + const config = Object.assign({}, defaultConfig, { pinVersions: false }); + expect(versionsHelper.determineUpgrades(qJson, '< 0.7.2', config)).toEqual([]); + }); it('supports > latest versions if configured', () => { const config = Object.assign({}, defaultConfig); config.respectLatest = false;