lix-website/themes/lix/assets/bootstrap/node_modules/ci-env/utils/drone.test.js
2024-04-26 22:49:34 -06:00

22 lines
506 B
JavaScript

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, '')
})
})