lix-website/themes/lix/assets/bootstrap/node_modules/ci-env/utils/drone.test.js

22 lines
506 B
JavaScript
Raw Normal View History

2024-04-27 03:39:10 +00:00
const test = require('ava')
const drone = require('./drone')
test('getLegacyRepo', t => {
const valid = [{
DRONE_REMOTE: 'git://github.com/siddharthkp/ci-env.git'
}, {
CI_REMOTE: 'git://github.com/siddharthkp/ci-env.git'
}]
const invalid = [{}]
const expected = 'siddharthkp/ci-env'
valid.forEach(env => {
const actual = drone.getLegacyRepo(env)
t.is(actual, expected)
})
invalid.forEach(env => {
const actual = drone.getLegacyRepo(env)
t.is(actual, '')
})
})