mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-01 12:10:07 -06:00
* temp 07/01/19 [skip ci] main lint files * use lint-staged scripts * fix all auto-fixable eslint errors * manually fix lint issues in files * temp 07/01/19 [skip ci] * bump eslint plugin versions, update circle.yml * [lint fix] remaining js files * update vscode/settings.json * add back stop-only * use stop-only for linting .onlys * fix verify_spec, build_spec * update json plugin * relint & apply corrections * fix appveyor.yml not cleansing env vars (very bad) * dont echo commit message in appveyor script * retry build & * re-add & upgrade lint-staged * update contributing docs * only let stop-only catch staged changes
46 lines
1.2 KiB
JavaScript
46 lines
1.2 KiB
JavaScript
const snapshot = require('snap-shot-it')
|
|
|
|
/* eslint-env mocha */
|
|
describe('getJustVersion', () => {
|
|
const { getJustVersion } = require('../utils')
|
|
|
|
it('returns semver if passed', () => {
|
|
snapshot(getJustVersion('0.20.1'))
|
|
})
|
|
|
|
it('returns semver with tag if passed', () => {
|
|
snapshot(getJustVersion('1.0.0-dev'))
|
|
})
|
|
|
|
it('returns name if starts with cypress', () => {
|
|
snapshot(getJustVersion('cypress@dev'))
|
|
snapshot(getJustVersion('cypress@alpha'))
|
|
snapshot(getJustVersion('cypress@0.20.3'))
|
|
})
|
|
|
|
it('returns name if matches cypress', () => {
|
|
snapshot(getJustVersion('cypress'))
|
|
})
|
|
|
|
it('extracts version from url', () => {
|
|
const url = 'https://foo.com/npm/0.20.3/develop-sha-13992/cypress.tgz'
|
|
const version = getJustVersion(url)
|
|
|
|
snapshot({ url, version })
|
|
})
|
|
|
|
it('extracts version with dev from url', () => {
|
|
const url = 'https://foo.com/npm/0.20.3-dev/develop-sha-13992/cypress.tgz'
|
|
const version = getJustVersion(url)
|
|
|
|
snapshot({ url, version })
|
|
})
|
|
|
|
it('for anything else returns the input', () => {
|
|
const url = 'babababa'
|
|
const version = getJustVersion(url)
|
|
|
|
snapshot({ url, version })
|
|
})
|
|
})
|