UNPKG

823 BJavaScriptView Raw
1var shippable = require('../../lib/services/shippable')
2
3describe('Shippable CI Provider', function() {
4 it('can detect shippable', function() {
5 process.env.SHIPPABLE = 'true'
6 expect(shippable.detect()).toBe(true)
7 })
8 it('can get shippable env info get_commit_status', function() {
9 process.env.SHIPPABLE = 'true'
10 process.env.BUILD_URL = 'http://...'
11 process.env.COMMIT = '5678'
12 process.env.BUILD_NUMBER = '91011'
13 process.env.BUILD_URL = 'http://...'
14 process.env.BRANCH = 'master'
15 process.env.PULL_REQUEST = '2'
16 process.env.REPO_NAME = 'owner/repo'
17 expect(shippable.configuration()).toEqual({
18 service: 'shippable',
19 commit: '5678',
20 build: '91011',
21 build_url: 'http://...',
22 branch: 'master',
23 pr: '2',
24 slug: 'owner/repo',
25 })
26 })
27})