Skip to content
Snippets Groups Projects
Commit 031d94d7 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

Revert "fix(docker): null is not a valid version"

This reverts commit 8f0279ec.
parent 27e30f13
No related branches found
No related tags found
No related merge requests found
...@@ -52,9 +52,6 @@ function isLessThanRange(version, range) { ...@@ -52,9 +52,6 @@ function isLessThanRange(version, range) {
return compare(version, range) < 0; return compare(version, range) < 0;
} }
function isValid(version) { function isValid(version) {
if (!version) {
return null;
}
const parsed = parse(version); const parsed = parse(version);
return parsed ? version : null; return parsed ? version : null;
} }
......
...@@ -4,7 +4,6 @@ const semver = require('../../lib/versioning')('semver'); ...@@ -4,7 +4,6 @@ const semver = require('../../lib/versioning')('semver');
describe('docker.isValid(input)', () => { describe('docker.isValid(input)', () => {
describe('isValid(version)', () => { describe('isValid(version)', () => {
it('should support all versions length', () => { it('should support all versions length', () => {
expect(docker.isValid(null)).toBe(null);
expect(docker.isValid('1.2.3')).toBe('1.2.3'); expect(docker.isValid('1.2.3')).toBe('1.2.3');
expect(docker.isValid('18.04')).toBe('18.04'); expect(docker.isValid('18.04')).toBe('18.04');
expect(docker.isValid('10.1')).toBe('10.1'); expect(docker.isValid('10.1')).toBe('10.1');
...@@ -12,7 +11,7 @@ describe('docker.isValid(input)', () => { ...@@ -12,7 +11,7 @@ describe('docker.isValid(input)', () => {
expect(docker.isValid('foo')).toBe(null); expect(docker.isValid('foo')).toBe(null);
}); });
}); });
describe('getMajor(version)', () => { describe('isValid(version)', () => {
it('should support all versions length', () => { it('should support all versions length', () => {
expect(docker.getMajor('1.2.3')).toBe(1); expect(docker.getMajor('1.2.3')).toBe(1);
expect(docker.getMajor('18.04')).toBe(18); expect(docker.getMajor('18.04')).toBe(18);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment