Skip to content

Commit cd95eec

Browse files
committed
Adding more tests to cirrus CI
1 parent c980f3c commit cd95eec

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

test/providers/provider_cirrus.test.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,38 @@ describe('Cirrus Params', () => {
5656
const params = providerCirrus.getServiceParams(inputs)
5757
expect(params).toMatchObject(expected)
5858
})
59+
60+
it('gets correct params for overrides', () => {
61+
const inputs = {
62+
args: {
63+
branch: 'branch',
64+
build: 3,
65+
pr: '2',
66+
sha: 'testsha',
67+
slug: 'testOrg/testRepo',
68+
},
69+
envs: {
70+
CI: true,
71+
CIRRUS_CI: true,
72+
CIRRUS_BRANCH: 'master',
73+
CIRRUS_CHANGE_IN_REPO: 'testingsha',
74+
CIRRUS_BUILD_ID: 2,
75+
CIRRUS_PR: 1,
76+
CIRRUS_REPO_FULL_NAME: 'https:/example.com/repo',
77+
},
78+
}
79+
const expected = {
80+
branch: 'branch',
81+
build: 3,
82+
buildURL: '',
83+
commit: 'testsha',
84+
job: '',
85+
pr: '2',
86+
service: 'cirrus-ci',
87+
slug: 'testOrg/testRepo',
88+
}
89+
90+
const params = providerCirrus.getServiceParams(inputs)
91+
expect(params).toMatchObject(expected)
92+
})
5993
})

0 commit comments

Comments
 (0)