mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 14:36:25 +00:00
refactor: replace test.each
with it.each
(#21859)
This commit is contained in:
parent
81b69bb4ef
commit
938a36801e
56 changed files with 323 additions and 323 deletions
|
@ -56,7 +56,7 @@ describe('config/presets/internal/regex-managers', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('matches regexes patterns', () => {
|
describe('matches regexes patterns', () => {
|
||||||
test.each`
|
it.each`
|
||||||
path | expected
|
path | expected
|
||||||
${'Dockerfile'} | ${true}
|
${'Dockerfile'} | ${true}
|
||||||
${'foo/Dockerfile'} | ${true}
|
${'foo/Dockerfile'} | ${true}
|
||||||
|
@ -134,7 +134,7 @@ describe('config/presets/internal/regex-managers', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('matches regexes patterns', () => {
|
describe('matches regexes patterns', () => {
|
||||||
test.each`
|
it.each`
|
||||||
path | expected
|
path | expected
|
||||||
${'.github/workflows/foo.yaml'} | ${true}
|
${'.github/workflows/foo.yaml'} | ${true}
|
||||||
${'.github/workflows/bar.yml'} | ${true}
|
${'.github/workflows/bar.yml'} | ${true}
|
||||||
|
@ -199,7 +199,7 @@ describe('config/presets/internal/regex-managers', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('matches regexes patterns', () => {
|
describe('matches regexes patterns', () => {
|
||||||
test.each`
|
it.each`
|
||||||
path | expected
|
path | expected
|
||||||
${'Chart.yaml'} | ${true}
|
${'Chart.yaml'} | ${true}
|
||||||
${'foo/Chart.yaml'} | ${true}
|
${'foo/Chart.yaml'} | ${true}
|
||||||
|
|
|
@ -13,7 +13,7 @@ const hostRules = mocked(_hostRules);
|
||||||
|
|
||||||
describe('modules/datasource/go/base', () => {
|
describe('modules/datasource/go/base', () => {
|
||||||
describe('simple cases', () => {
|
describe('simple cases', () => {
|
||||||
test.each`
|
it.each`
|
||||||
module | datasource | packageName
|
module | datasource | packageName
|
||||||
${'gopkg.in/foo'} | ${'github-tags'} | ${'go-foo/foo'}
|
${'gopkg.in/foo'} | ${'github-tags'} | ${'go-foo/foo'}
|
||||||
${'gopkg.in/foo/bar'} | ${'github-tags'} | ${'foo/bar'}
|
${'gopkg.in/foo/bar'} | ${'github-tags'} | ${'foo/bar'}
|
||||||
|
|
|
@ -10,7 +10,7 @@ const repo = load(Fixtures.get('sample.yaml'), {
|
||||||
|
|
||||||
describe('modules/datasource/helm/common', () => {
|
describe('modules/datasource/helm/common', () => {
|
||||||
describe('findSourceUrl', () => {
|
describe('findSourceUrl', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input | output
|
input | output
|
||||||
${'airflow'} | ${'https://github.com/bitnami/charts/tree/master/bitnami/airflow'}
|
${'airflow'} | ${'https://github.com/bitnami/charts/tree/master/bitnami/airflow'}
|
||||||
${'coredns'} | ${'https://github.com/coredns/helm'}
|
${'coredns'} | ${'https://github.com/coredns/helm'}
|
||||||
|
|
|
@ -78,7 +78,7 @@ describe('modules/datasource/metadata', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
sourceUrl | expectedSourceUrl | expectedSourceDirectory
|
sourceUrl | expectedSourceUrl | expectedSourceDirectory
|
||||||
${'https://github.com/bitnami/charts/tree/master/bitnami/kube-prometheus'} | ${'https://github.com/bitnami/charts'} | ${'bitnami/kube-prometheus'}
|
${'https://github.com/bitnami/charts/tree/master/bitnami/kube-prometheus'} | ${'https://github.com/bitnami/charts'} | ${'bitnami/kube-prometheus'}
|
||||||
${'https://gitlab.com/group/sub-group/repo/tree/main/some/path'} | ${'https://gitlab.com/group/sub-group/repo'} | ${'some/path'}
|
${'https://gitlab.com/group/sub-group/repo/tree/main/some/path'} | ${'https://gitlab.com/group/sub-group/repo'} | ${'some/path'}
|
||||||
|
@ -98,7 +98,7 @@ describe('modules/datasource/metadata', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
sourceUrl
|
sourceUrl
|
||||||
${'https://github.com/bitnami'}
|
${'https://github.com/bitnami'}
|
||||||
${'https://github.com/bitnami/charts'}
|
${'https://github.com/bitnami/charts'}
|
||||||
|
@ -297,7 +297,7 @@ describe('modules/datasource/metadata', () => {
|
||||||
expect(massageUrl('not a url')).toMatch('');
|
expect(massageUrl('not a url')).toMatch('');
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
sourceUrl
|
sourceUrl
|
||||||
${'git@github.com:user/repo'}
|
${'git@github.com:user/repo'}
|
||||||
${'http://github.com/user/repo'}
|
${'http://github.com/user/repo'}
|
||||||
|
@ -311,7 +311,7 @@ describe('modules/datasource/metadata', () => {
|
||||||
expect(massageUrl(sourceUrl)).toBe('https://github.com/user/repo');
|
expect(massageUrl(sourceUrl)).toBe('https://github.com/user/repo');
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
sourceUrl
|
sourceUrl
|
||||||
${'http://gitlab.com/user/repo'}
|
${'http://gitlab.com/user/repo'}
|
||||||
${'git://gitlab.com/user/repo'}
|
${'git://gitlab.com/user/repo'}
|
||||||
|
@ -323,7 +323,7 @@ describe('modules/datasource/metadata', () => {
|
||||||
expect(massageUrl(sourceUrl)).toBe('https://gitlab.com/user/repo');
|
expect(massageUrl(sourceUrl)).toBe('https://gitlab.com/user/repo');
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
sourceUrl
|
sourceUrl
|
||||||
${'git@example.com:user/repo'}
|
${'git@example.com:user/repo'}
|
||||||
${'http://example.com/user/repo'}
|
${'http://example.com/user/repo'}
|
||||||
|
@ -484,7 +484,7 @@ describe('modules/datasource/metadata', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
sourceUrl | homepage | expected
|
sourceUrl | homepage | expected
|
||||||
${'not a url'} | ${'https://gitlab.com/org/repo'} | ${false}
|
${'not a url'} | ${'https://gitlab.com/org/repo'} | ${false}
|
||||||
${'https://gitlab.com/org/repo'} | ${'not a url'} | ${false}
|
${'https://gitlab.com/org/repo'} | ${'not a url'} | ${false}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { parseDepsEdnFile } from './parser';
|
||||||
|
|
||||||
describe('modules/manager/deps-edn/parser', () => {
|
describe('modules/manager/deps-edn/parser', () => {
|
||||||
describe('parseEdnFile', () => {
|
describe('parseEdnFile', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input | output
|
input | output
|
||||||
${''} | ${undefined}
|
${''} | ${undefined}
|
||||||
${':foo'} | ${undefined}
|
${':foo'} | ${undefined}
|
||||||
|
|
|
@ -25,7 +25,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
|
|
||||||
describe('variables', () => {
|
describe('variables', () => {
|
||||||
describe('Groovy: single var assignments', () => {
|
describe('Groovy: single var assignments', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input | name | value
|
input | name | value
|
||||||
${'foo = "1.2.3"'} | ${'foo'} | ${'1.2.3'}
|
${'foo = "1.2.3"'} | ${'foo'} | ${'1.2.3'}
|
||||||
${'foo.bar = "1.2.3"'} | ${'foo.bar'} | ${'1.2.3'}
|
${'foo.bar = "1.2.3"'} | ${'foo.bar'} | ${'1.2.3'}
|
||||||
|
@ -50,7 +50,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Groovy: single var assignments (non-match)', () => {
|
describe('Groovy: single var assignments (non-match)', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input
|
input
|
||||||
${'foo[["bar"]] = "baz"'}
|
${'foo[["bar"]] = "baz"'}
|
||||||
${'foo["bar", "invalid"] = "1.2.3"'}
|
${'foo["bar", "invalid"] = "1.2.3"'}
|
||||||
|
@ -192,7 +192,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Kotlin: single var assignments', () => {
|
describe('Kotlin: single var assignments', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input | name | value
|
input | name | value
|
||||||
${'set("foo", "1.2.3")'} | ${'foo'} | ${'1.2.3'}
|
${'set("foo", "1.2.3")'} | ${'foo'} | ${'1.2.3'}
|
||||||
${'version("foo", "1.2.3")'} | ${'foo'} | ${'1.2.3'}
|
${'version("foo", "1.2.3")'} | ${'foo'} | ${'1.2.3'}
|
||||||
|
@ -204,7 +204,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Kotlin: single var assignments (non-match)', () => {
|
describe('Kotlin: single var assignments (non-match)', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input
|
input
|
||||||
${'set(["foo", "bar"])'}
|
${'set(["foo", "bar"])'}
|
||||||
${'set("foo", "bar", "baz", "qux"])'}
|
${'set("foo", "bar", "baz", "qux"])'}
|
||||||
|
@ -215,7 +215,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Kotlin: single extra var assignments', () => {
|
describe('Kotlin: single extra var assignments', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input | name | value
|
input | name | value
|
||||||
${'val foo by extra("1.2.3")'} | ${'foo'} | ${'1.2.3'}
|
${'val foo by extra("1.2.3")'} | ${'foo'} | ${'1.2.3'}
|
||||||
${'val foo by extra { "1.2.3" }'} | ${'foo'} | ${'1.2.3'}
|
${'val foo by extra { "1.2.3" }'} | ${'foo'} | ${'1.2.3'}
|
||||||
|
@ -333,7 +333,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
|
|
||||||
describe('dependencies', () => {
|
describe('dependencies', () => {
|
||||||
describe('simple dependency strings', () => {
|
describe('simple dependency strings', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input | output
|
input | output
|
||||||
${'"foo:bar:1.2.3"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }}
|
${'"foo:bar:1.2.3"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }}
|
||||||
${'"foo:bar:1.2.3@zip"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', dataType: 'zip' }}
|
${'"foo:bar:1.2.3@zip"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', dataType: 'zip' }}
|
||||||
|
@ -347,7 +347,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('interpolated dependency strings', () => {
|
describe('interpolated dependency strings', () => {
|
||||||
test.each`
|
it.each`
|
||||||
def | str | output
|
def | str | output
|
||||||
${'foo = "1.2.3"'} | ${'"foo:bar:$foo@@@"'} | ${null}
|
${'foo = "1.2.3"'} | ${'"foo:bar:$foo@@@"'} | ${null}
|
||||||
${''} | ${'"foo:bar:$baz"'} | ${null}
|
${''} | ${'"foo:bar:$baz"'} | ${null}
|
||||||
|
@ -370,7 +370,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('concatenated dependency strings', () => {
|
describe('concatenated dependency strings', () => {
|
||||||
test.each`
|
it.each`
|
||||||
def | str | output
|
def | str | output
|
||||||
${''} | ${'"foo:bar" + ":1.2.3"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', managerData: { fileReplacePosition: 15 } }}
|
${''} | ${'"foo:bar" + ":1.2.3"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', managerData: { fileReplacePosition: 15 } }}
|
||||||
${''} | ${'"foo:bar:" + "1.2.3"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', managerData: { fileReplacePosition: 15 } }}
|
${''} | ${'"foo:bar:" + "1.2.3"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', managerData: { fileReplacePosition: 15 } }}
|
||||||
|
@ -391,7 +391,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('property accessors', () => {
|
describe('property accessors', () => {
|
||||||
test.each`
|
it.each`
|
||||||
accessor
|
accessor
|
||||||
${'property'}
|
${'property'}
|
||||||
${'getProperty'}
|
${'getProperty'}
|
||||||
|
@ -425,7 +425,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
currentValue: '1.2.3',
|
currentValue: '1.2.3',
|
||||||
};
|
};
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
def | str | output
|
def | str | output
|
||||||
${''} | ${'kotlin("foo", "1.2.3")'} | ${output}
|
${''} | ${'kotlin("foo", "1.2.3")'} | ${output}
|
||||||
${''} | ${'kotlin("foo", version = "1.2.3")'} | ${output}
|
${''} | ${'kotlin("foo", version = "1.2.3")'} | ${output}
|
||||||
|
@ -447,7 +447,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('map notation dependencies', () => {
|
describe('map notation dependencies', () => {
|
||||||
test.each`
|
it.each`
|
||||||
def | str | output
|
def | str | output
|
||||||
${''} | ${'group: "foo", name: "bar", version: "1.2.3"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }}
|
${''} | ${'group: "foo", name: "bar", version: "1.2.3"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }}
|
||||||
${''} | ${'group: "foo", name: "bar", version: baz'} | ${null}
|
${''} | ${'group: "foo", name: "bar", version: baz'} | ${null}
|
||||||
|
@ -526,7 +526,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
return { ...dep, groupName: 'baz' };
|
return { ...dep, groupName: 'baz' };
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
def | str | output
|
def | str | output
|
||||||
${''} | ${'dependencySet([group: "foo", version: "1.2.3"]) { entry "bar1" }'} | ${{}}
|
${''} | ${'dependencySet([group: "foo", version: "1.2.3"]) { entry "bar1" }'} | ${{}}
|
||||||
${''} | ${'dependencySet(group: "foo", version: "1.2.3", group: "foo", version: "1.2.3") { entry "bar1" }'} | ${{}}
|
${''} | ${'dependencySet(group: "foo", version: "1.2.3", group: "foo", version: "1.2.3") { entry "bar1" }'} | ${{}}
|
||||||
|
@ -553,7 +553,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('plugins', () => {
|
describe('plugins', () => {
|
||||||
test.each`
|
it.each`
|
||||||
def | input | output
|
def | input | output
|
||||||
${''} | ${'id "foo.bar" version "1.2.3"'} | ${{ depName: 'foo.bar', packageName: 'foo.bar:foo.bar.gradle.plugin', currentValue: '1.2.3' }}
|
${''} | ${'id "foo.bar" version "1.2.3"'} | ${{ depName: 'foo.bar', packageName: 'foo.bar:foo.bar.gradle.plugin', currentValue: '1.2.3' }}
|
||||||
${''} | ${'id("foo.bar").version("1.2.3")'} | ${{ depName: 'foo.bar', packageName: 'foo.bar:foo.bar.gradle.plugin', currentValue: '1.2.3' }}
|
${''} | ${'id("foo.bar").version("1.2.3")'} | ${{ depName: 'foo.bar', packageName: 'foo.bar:foo.bar.gradle.plugin', currentValue: '1.2.3' }}
|
||||||
|
@ -586,7 +586,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
|
|
||||||
describe('registries', () => {
|
describe('registries', () => {
|
||||||
describe('predefined registries', () => {
|
describe('predefined registries', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input | output
|
input | output
|
||||||
${'mavenCentral()'} | ${REGISTRY_URLS.mavenCentral}
|
${'mavenCentral()'} | ${REGISTRY_URLS.mavenCentral}
|
||||||
${'google()'} | ${REGISTRY_URLS.google}
|
${'google()'} | ${REGISTRY_URLS.google}
|
||||||
|
@ -600,7 +600,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('custom registries', () => {
|
describe('custom registries', () => {
|
||||||
test.each`
|
it.each`
|
||||||
def | input | url
|
def | input | url
|
||||||
${''} | ${'maven("")'} | ${null}
|
${''} | ${'maven("")'} | ${null}
|
||||||
${''} | ${'maven(["https://foo.bar/baz/qux"])'} | ${null}
|
${''} | ${'maven(["https://foo.bar/baz/qux"])'} | ${null}
|
||||||
|
@ -702,7 +702,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('version catalog', () => {
|
describe('version catalog', () => {
|
||||||
test.each`
|
it.each`
|
||||||
def | str | output
|
def | str | output
|
||||||
${''} | ${'library("foo.bar", "foo", "bar").version("1.2.3")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }}
|
${''} | ${'library("foo.bar", "foo", "bar").version("1.2.3")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }}
|
||||||
${'baz = "1.2.3"'} | ${'library("foo.bar", "foo", "bar").version(baz)'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }}
|
${'baz = "1.2.3"'} | ${'library("foo.bar", "foo", "bar").version(baz)'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }}
|
||||||
|
@ -736,7 +736,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('heuristic dependency matching', () => {
|
describe('heuristic dependency matching', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input | output
|
input | output
|
||||||
${'("foo", "bar", "1.2.3")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }}
|
${'("foo", "bar", "1.2.3")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }}
|
||||||
${'("foo", "bar", "1.2.3", "4.5.6")'} | ${null}
|
${'("foo", "bar", "1.2.3", "4.5.6")'} | ${null}
|
||||||
|
@ -774,7 +774,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('gradle.properties', () => {
|
describe('gradle.properties', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input | key | value | fileReplacePosition
|
input | key | value | fileReplacePosition
|
||||||
${'foo=bar'} | ${'foo'} | ${'bar'} | ${4}
|
${'foo=bar'} | ${'foo'} | ${'bar'} | ${4}
|
||||||
${' foo = bar '} | ${'foo'} | ${'bar'} | ${7}
|
${' foo = bar '} | ${'foo'} | ${'bar'} | ${7}
|
||||||
|
@ -836,7 +836,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
'foo/bar.gradle': key + ' = "' + value + '"',
|
'foo/bar.gradle': key + ' = "' + value + '"',
|
||||||
};
|
};
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
def | input | output
|
def | input | output
|
||||||
${''} | ${'apply from: ""'} | ${{}}
|
${''} | ${'apply from: ""'} | ${{}}
|
||||||
${''} | ${'apply from: "foo/invalid.gradle"'} | ${{}}
|
${''} | ${'apply from: "foo/invalid.gradle"'} | ${{}}
|
||||||
|
@ -898,7 +898,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('implicit gradle plugins', () => {
|
describe('implicit gradle plugins', () => {
|
||||||
test.each`
|
it.each`
|
||||||
def | input | output
|
def | input | output
|
||||||
${'baz = "1.2.3"'} | ${'checkstyle { toolVersion = "${baz}" }'} | ${{ depName: 'checkstyle', packageName: GRADLE_PLUGINS['checkstyle'][1], currentValue: '1.2.3' }}
|
${'baz = "1.2.3"'} | ${'checkstyle { toolVersion = "${baz}" }'} | ${{ depName: 'checkstyle', packageName: GRADLE_PLUGINS['checkstyle'][1], currentValue: '1.2.3' }}
|
||||||
${'baz = "1.2.3"'} | ${'checkstyle { toolVersion "${baz}" }'} | ${{ depName: 'checkstyle', packageName: GRADLE_PLUGINS['checkstyle'][1], currentValue: '1.2.3' }}
|
${'baz = "1.2.3"'} | ${'checkstyle { toolVersion "${baz}" }'} | ${{ depName: 'checkstyle', packageName: GRADLE_PLUGINS['checkstyle'][1], currentValue: '1.2.3' }}
|
||||||
|
|
|
@ -10,7 +10,7 @@ describe('modules/manager/hermit/default-config', () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
path | expected
|
path | expected
|
||||||
${'bin/hermit'} | ${true}
|
${'bin/hermit'} | ${true}
|
||||||
${'gradle/bin/hermit'} | ${true}
|
${'gradle/bin/hermit'} | ${true}
|
||||||
|
@ -27,7 +27,7 @@ describe('modules/manager/hermit/default-config', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('fileMatch', () => {
|
describe('fileMatch', () => {
|
||||||
test.each`
|
it.each`
|
||||||
path | expected
|
path | expected
|
||||||
${'bin/hermit'} | ${true}
|
${'bin/hermit'} | ${true}
|
||||||
${'gradle/bin/hermit'} | ${true}
|
${'gradle/bin/hermit'} | ${true}
|
||||||
|
|
|
@ -8,7 +8,7 @@ describe('modules/manager/metadata', () => {
|
||||||
.filter((name) => !name.startsWith('__'))
|
.filter((name) => !name.startsWith('__'))
|
||||||
.sort();
|
.sort();
|
||||||
|
|
||||||
test.each(managerList)('%s has readme with no h1 or h2', async (manager) => {
|
it.each(managerList)('%s has readme with no h1 or h2', async (manager) => {
|
||||||
let readme: string | undefined;
|
let readme: string | undefined;
|
||||||
try {
|
try {
|
||||||
readme = await fs.readFile(`${__dirname}/${manager}/readme.md`, 'utf8');
|
readme = await fs.readFile(`${__dirname}/${manager}/readme.md`, 'utf8');
|
||||||
|
|
|
@ -15,7 +15,7 @@ describe('modules/platform/github/massage-markdown-links', () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input
|
input
|
||||||
${'github.com'}
|
${'github.com'}
|
||||||
${'github.com/foo/bar'}
|
${'github.com/foo/bar'}
|
||||||
|
@ -57,7 +57,7 @@ describe('modules/platform/github/massage-markdown-links', () => {
|
||||||
expect(massageMarkdownLinks(inputLink)).toEqual(inputLink);
|
expect(massageMarkdownLinks(inputLink)).toEqual(inputLink);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | output
|
input | output
|
||||||
${'github.com/foo/bar/discussions/1'} | ${'[github.com/foo/bar/discussions/1](togithub.com/foo/bar/discussions/1)'}
|
${'github.com/foo/bar/discussions/1'} | ${'[github.com/foo/bar/discussions/1](togithub.com/foo/bar/discussions/1)'}
|
||||||
${'github.com/foo/bar/issues/1'} | ${'[github.com/foo/bar/issues/1](togithub.com/foo/bar/issues/1)'}
|
${'github.com/foo/bar/issues/1'} | ${'[github.com/foo/bar/issues/1](togithub.com/foo/bar/issues/1)'}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { api as semver } from '.';
|
import { api as semver } from '.';
|
||||||
|
|
||||||
describe('modules/versioning/cargo/index', () => {
|
describe('modules/versioning/cargo/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'4.2.0'} | ${'4.2, >= 3.0, < 5.0.0'} | ${true}
|
${'4.2.0'} | ${'4.2, >= 3.0, < 5.0.0'} | ${true}
|
||||||
${'4.2.0'} | ${'2.0, >= 3.0, < 5.0.0'} | ${false}
|
${'4.2.0'} | ${'2.0, >= 3.0, < 5.0.0'} | ${false}
|
||||||
|
@ -15,7 +15,7 @@ describe('modules/versioning/cargo/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['4.2.1', '0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'4.*.0, < 4.2.5'} | ${'4.2.1'}
|
${['4.2.1', '0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'4.*.0, < 4.2.5'} | ${'4.2.1'}
|
||||||
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0', '5.0.3']} | ${'5.0, > 5.0.0'} | ${'5.0.3'}
|
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0', '5.0.3']} | ${'5.0, > 5.0.0'} | ${'5.0.3'}
|
||||||
|
@ -26,7 +26,7 @@ describe('modules/versioning/cargo/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1'} | ${true}
|
${'1'} | ${true}
|
||||||
${'1.2'} | ${true}
|
${'1.2'} | ${true}
|
||||||
|
@ -40,7 +40,7 @@ describe('modules/versioning/cargo/index', () => {
|
||||||
expect(!!semver.isValid(version)).toBe(expected);
|
expect(!!semver.isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1'} | ${false}
|
${'1'} | ${false}
|
||||||
${'1.2'} | ${false}
|
${'1.2'} | ${false}
|
||||||
|
@ -49,7 +49,7 @@ describe('modules/versioning/cargo/index', () => {
|
||||||
expect(!!semver.isVersion(version)).toBe(expected);
|
expect(!!semver.isVersion(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'0.9.0'} | ${'>= 1.0.0 <= 2.0.0'} | ${true}
|
${'0.9.0'} | ${'>= 1.0.0 <= 2.0.0'} | ${true}
|
||||||
${'1.9.0'} | ${'>= 1.0.0 <= 2.0.0'} | ${false}
|
${'1.9.0'} | ${'>= 1.0.0 <= 2.0.0'} | ${false}
|
||||||
|
@ -60,7 +60,7 @@ describe('modules/versioning/cargo/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['0.4.0', '0.5.0', '4.2.0', '4.3.0', '5.0.0']} | ${'4.*, > 4.2'} | ${'4.3.0'}
|
${['0.4.0', '0.5.0', '4.2.0', '4.3.0', '5.0.0']} | ${'4.*, > 4.2'} | ${'4.3.0'}
|
||||||
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'4.0.0'} | ${'4.2.0'}
|
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'4.0.0'} | ${'4.2.0'}
|
||||||
|
@ -74,7 +74,7 @@ describe('modules/versioning/cargo/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.3'} | ${false}
|
${'1.2.3'} | ${false}
|
||||||
${'1.2.3-alpha.1'} | ${false}
|
${'1.2.3-alpha.1'} | ${false}
|
||||||
|
@ -90,7 +90,7 @@ describe('modules/versioning/cargo/index', () => {
|
||||||
expect(!!semver.isSingleVersion(version)).toBe(expected);
|
expect(!!semver.isSingleVersion(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'*'} | ${'pin'} | ${'1.0.0'} | ${'1.0.0'} | ${'=1.0.0'}
|
${'*'} | ${'pin'} | ${'1.0.0'} | ${'1.0.0'} | ${'=1.0.0'}
|
||||||
${'1'} | ${'pin'} | ${'1.0.0'} | ${'1.0.0'} | ${'=1.0.0'}
|
${'1'} | ${'pin'} | ${'1.0.0'} | ${'1.0.0'} | ${'=1.0.0'}
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import { api as semver } from '.';
|
import { api as semver } from '.';
|
||||||
|
|
||||||
describe('modules/versioning/composer/index', () => {
|
describe('modules/versioning/composer/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.0'} | ${0}
|
${'1.2.0'} | ${0}
|
||||||
`('getPatch("$version") === $expected', ({ version, expected }) => {
|
`('getPatch("$version") === $expected', ({ version, expected }) => {
|
||||||
expect(semver.getPatch(version)).toBe(expected);
|
expect(semver.getPatch(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'1.2.0'} | ${'v1.2'} | ${true}
|
${'1.2.0'} | ${'v1.2'} | ${true}
|
||||||
${'v1.0.0'} | ${'1'} | ${true}
|
${'v1.0.0'} | ${'1'} | ${true}
|
||||||
|
@ -19,7 +19,7 @@ describe('modules/versioning/composer/index', () => {
|
||||||
expect(semver.equals(a, b)).toBe(expected);
|
expect(semver.equals(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'1.2.0'} | ${'v1.2'} | ${false}
|
${'1.2.0'} | ${'v1.2'} | ${false}
|
||||||
${'v1.0.1'} | ${'1'} | ${true}
|
${'v1.0.1'} | ${'1'} | ${true}
|
||||||
|
@ -28,7 +28,7 @@ describe('modules/versioning/composer/index', () => {
|
||||||
expect(semver.isGreaterThan(a, b)).toBe(expected);
|
expect(semver.isGreaterThan(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'v1.2'} | ${true}
|
${'v1.2'} | ${true}
|
||||||
`('isSingleVersion("$version") === $expected', ({ version, expected }) => {
|
`('isSingleVersion("$version") === $expected', ({ version, expected }) => {
|
||||||
|
@ -36,7 +36,7 @@ describe('modules/versioning/composer/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'v1.2'} | ${true}
|
${'v1.2'} | ${true}
|
||||||
`('isStable("$version") === $expected', ({ version, expected }) => {
|
`('isStable("$version") === $expected', ({ version, expected }) => {
|
||||||
|
@ -44,7 +44,7 @@ describe('modules/versioning/composer/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
${'1.2.3-foo'} | ${true}
|
${'1.2.3-foo'} | ${true}
|
||||||
|
@ -74,7 +74,7 @@ describe('modules/versioning/composer/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'0.3.1'} | ${'~0.4'} | ${true}
|
${'0.3.1'} | ${'~0.4'} | ${true}
|
||||||
${'0.5.1'} | ${'~0.4'} | ${false}
|
${'0.5.1'} | ${'~0.4'} | ${false}
|
||||||
|
@ -82,7 +82,7 @@ describe('modules/versioning/composer/index', () => {
|
||||||
expect(semver.isLessThanRange?.(a, b)).toBe(expected);
|
expect(semver.isLessThanRange?.(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'~6'} | ${null}
|
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'~6'} | ${null}
|
||||||
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'~4'} | ${'4.2.0'}
|
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'~4'} | ${'4.2.0'}
|
||||||
|
@ -96,7 +96,7 @@ describe('modules/versioning/composer/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'~6'} | ${null}
|
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'~6'} | ${null}
|
||||||
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'~4'} | ${'4.0.0'}
|
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'~4'} | ${'4.0.0'}
|
||||||
|
@ -110,7 +110,7 @@ describe('modules/versioning/composer/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'0.3.1'} | ${'~0.4'} | ${false}
|
${'0.3.1'} | ${'~0.4'} | ${false}
|
||||||
${'0.5.1'} | ${'~0.4'} | ${true}
|
${'0.5.1'} | ${'~0.4'} | ${true}
|
||||||
|
@ -118,7 +118,7 @@ describe('modules/versioning/composer/index', () => {
|
||||||
expect(semver.matches(a, b)).toBe(expected);
|
expect(semver.matches(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'1.0.0'} | ${'1.0.0'} | ${true}
|
${'1.0.0'} | ${'1.0.0'} | ${true}
|
||||||
${'1.0.0'} | ${'>=1.0.0'} | ${true}
|
${'1.0.0'} | ${'>=1.0.0'} | ${true}
|
||||||
|
@ -138,7 +138,7 @@ describe('modules/versioning/composer/index', () => {
|
||||||
expect(semver.subset!(a, b)).toBe(expected);
|
expect(semver.subset!(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'~1.0'} | ${'pin'} | ${'1.0'} | ${'V1.1'} | ${'V1.1'}
|
${'~1.0'} | ${'pin'} | ${'1.0'} | ${'V1.1'} | ${'V1.1'}
|
||||||
${'^1.0'} | ${'pin'} | ${'1.0'} | ${'V1.1'} | ${'V1.1'}
|
${'^1.0'} | ${'pin'} | ${'1.0'} | ${'V1.1'} | ${'V1.1'}
|
||||||
|
@ -196,14 +196,14 @@ describe('modules/versioning/composer/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | expected
|
versions | expected
|
||||||
${['1.2.3-beta', '1.0.0-alpha24', '2.0.1', '1.3.4', '1.0.0-alpha9', '1.2.3']} | ${['1.0.0-alpha9', '1.0.0-alpha24', '1.2.3-beta', '1.2.3', '1.3.4', '2.0.1']}
|
${['1.2.3-beta', '1.0.0-alpha24', '2.0.1', '1.3.4', '1.0.0-alpha9', '1.2.3']} | ${['1.0.0-alpha9', '1.0.0-alpha24', '1.2.3-beta', '1.2.3', '1.3.4', '2.0.1']}
|
||||||
`('$versions -> sortVersions -> $expected ', ({ versions, expected }) => {
|
`('$versions -> sortVersions -> $expected ', ({ versions, expected }) => {
|
||||||
expect(versions.sort(semver.sortVersions)).toEqual(expected);
|
expect(versions.sort(semver.sortVersions)).toEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.0'} | ${true}
|
${'1.2.0'} | ${true}
|
||||||
`('isCompatible("$version") === $expected', ({ version, expected }) => {
|
`('isCompatible("$version") === $expected', ({ version, expected }) => {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { api as conan } from '.';
|
||||||
|
|
||||||
describe('modules/versioning/conan/index', () => {
|
describe('modules/versioning/conan/index', () => {
|
||||||
// isValid(version: string): boolean;
|
// isValid(version: string): boolean;
|
||||||
test.each`
|
it.each`
|
||||||
version | result
|
version | result
|
||||||
${'[1.2.3.4, loose=False]'} | ${false}
|
${'[1.2.3.4, loose=False]'} | ${false}
|
||||||
${'[NOT VALID, loose=False]'} | ${false}
|
${'[NOT VALID, loose=False]'} | ${false}
|
||||||
|
@ -114,7 +114,7 @@ describe('modules/versioning/conan/index', () => {
|
||||||
|
|
||||||
// isVersion(version: string): boolean;
|
// isVersion(version: string): boolean;
|
||||||
// isSingleVersion(version: string): boolean;
|
// isSingleVersion(version: string): boolean;
|
||||||
test.each`
|
it.each`
|
||||||
version | result
|
version | result
|
||||||
${'1.0.7-prerelease.1'} | ${true}
|
${'1.0.7-prerelease.1'} | ${true}
|
||||||
${'1.0.7-prerelease.1, include_prerelease=True'} | ${true}
|
${'1.0.7-prerelease.1, include_prerelease=True'} | ${true}
|
||||||
|
@ -160,7 +160,7 @@ describe('modules/versioning/conan/index', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
// isCompatible(version: string, range?: string): boolean;
|
// isCompatible(version: string, range?: string): boolean;
|
||||||
test.each`
|
it.each`
|
||||||
range | version | result
|
range | version | result
|
||||||
${'[>1.1 <2.0]'} | ${'1.2.3'} | ${true}
|
${'[>1.1 <2.0]'} | ${'1.2.3'} | ${true}
|
||||||
${'["~1.2.3", loose=False, include_prerelease=True]'} | ${'1.2.3-pre.1'} | ${false}
|
${'["~1.2.3", loose=False, include_prerelease=True]'} | ${'1.2.3-pre.1'} | ${false}
|
||||||
|
@ -355,7 +355,7 @@ describe('modules/versioning/conan/index', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
// matches(version: string, range: string | Range): string | boolean | null;
|
// matches(version: string, range: string | Range): string | boolean | null;
|
||||||
test.each`
|
it.each`
|
||||||
range | version | result
|
range | version | result
|
||||||
${'[>1.1 <2.0]'} | ${'1.2.3'} | ${true}
|
${'[>1.1 <2.0]'} | ${'1.2.3'} | ${true}
|
||||||
${'["~1.2.3", loose=False, include_prerelease=True]'} | ${'1.2.3-pre.1'} | ${true}
|
${'["~1.2.3", loose=False, include_prerelease=True]'} | ${'1.2.3-pre.1'} | ${true}
|
||||||
|
@ -550,7 +550,7 @@ describe('modules/versioning/conan/index', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
// isStable(version: string): boolean;
|
// isStable(version: string): boolean;
|
||||||
test.each`
|
it.each`
|
||||||
version | result
|
version | result
|
||||||
${'5.0.1'} | ${true}
|
${'5.0.1'} | ${true}
|
||||||
${'19.00'} | ${true}
|
${'19.00'} | ${true}
|
||||||
|
@ -562,7 +562,7 @@ describe('modules/versioning/conan/index', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
// getNewValue(newValueConfig: NewValueConfig): string;
|
// getNewValue(newValueConfig: NewValueConfig): string;
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | result
|
currentValue | rangeStrategy | currentVersion | newVersion | result
|
||||||
${'[<=1.2.3]'} | ${'widen'} | ${'1.0.0'} | ${'1.2.3'} | ${'[<=1.2.3]'}
|
${'[<=1.2.3]'} | ${'widen'} | ${'1.0.0'} | ${'1.2.3'} | ${'[<=1.2.3]'}
|
||||||
${'[<1.2.3]'} | ${'widen'} | ${'1.5.5'} | ${'1.5.6'} | ${'[<1.5.7]'}
|
${'[<1.2.3]'} | ${'widen'} | ${'1.5.5'} | ${'1.5.6'} | ${'[<1.5.7]'}
|
||||||
|
@ -647,7 +647,7 @@ describe('modules/versioning/conan/index', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
// getSatisfyingVersion(versions: string[], range: string): string | null;
|
// getSatisfyingVersion(versions: string[], range: string): string | null;
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | result
|
versions | range | result
|
||||||
${['1.2.4', '1.2.3', '1.2.5-beta']} | ${'["~1.2.3", loose=False, include_prerelease=True]'} | ${'1.2.5-beta'}
|
${['1.2.4', '1.2.3', '1.2.5-beta']} | ${'["~1.2.3", loose=False, include_prerelease=True]'} | ${'1.2.5-beta'}
|
||||||
${['1.2.4', '1.2.3', '1.2.5-beta']} | ${'["~1.2.3", loose=False, include_prerelease=False]'} | ${'1.2.4'}
|
${['1.2.4', '1.2.3', '1.2.5-beta']} | ${'["~1.2.3", loose=False, include_prerelease=False]'} | ${'1.2.4'}
|
||||||
|
@ -705,7 +705,7 @@ describe('modules/versioning/conan/index', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
// minSatisfyingVersion(versions: string[], range: string): string | null;
|
// minSatisfyingVersion(versions: string[], range: string): string | null;
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | result
|
versions | range | result
|
||||||
${['1.2.3', '1.2.4', '1.2.5', '1.2.6', '2.0.1']} | ${'["~1.2.3", loose=False]'} | ${'1.2.3'}
|
${['1.2.3', '1.2.4', '1.2.5', '1.2.6', '2.0.1']} | ${'["~1.2.3", loose=False]'} | ${'1.2.3'}
|
||||||
${['1.1.0', '1.2.0', '1.3.0', '2.0.0b1', '2.0.0b3', '2.0.0', '2.1.0']} | ${'[~2.0.0]'} | ${'2.0.0'}
|
${['1.1.0', '1.2.0', '1.3.0', '2.0.0b1', '2.0.0b3', '2.0.0', '2.1.0']} | ${'[~2.0.0]'} | ${'2.0.0'}
|
||||||
|
@ -726,7 +726,7 @@ describe('modules/versioning/conan/index', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
// test 4-digit
|
// test 4-digit
|
||||||
test.each`
|
it.each`
|
||||||
version | major | minor | patch
|
version | major | minor | patch
|
||||||
${'4.1.3'} | ${4} | ${1} | ${3}
|
${'4.1.3'} | ${4} | ${1} | ${3}
|
||||||
${'4.1.3+jenkins'} | ${4} | ${1} | ${3}
|
${'4.1.3+jenkins'} | ${4} | ${1} | ${3}
|
||||||
|
@ -749,7 +749,7 @@ describe('modules/versioning/conan/index', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
// getMajor(version: string): null | number;
|
// getMajor(version: string): null | number;
|
||||||
test.each`
|
it.each`
|
||||||
version | result
|
version | result
|
||||||
${'4.1.33.2'} | ${4}
|
${'4.1.33.2'} | ${4}
|
||||||
`('getMajor("$version") === "$result"', ({ version, result }) => {
|
`('getMajor("$version") === "$result"', ({ version, result }) => {
|
||||||
|
@ -758,7 +758,7 @@ describe('modules/versioning/conan/index', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
// getMinor(version: string): null | number;
|
// getMinor(version: string): null | number;
|
||||||
test.each`
|
it.each`
|
||||||
version | result
|
version | result
|
||||||
${'1.2.3'} | ${2}
|
${'1.2.3'} | ${2}
|
||||||
${'5.2.1'} | ${2}
|
${'5.2.1'} | ${2}
|
||||||
|
@ -769,7 +769,7 @@ describe('modules/versioning/conan/index', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
// getPatch(version: string): null | number;
|
// getPatch(version: string): null | number;
|
||||||
test.each`
|
it.each`
|
||||||
version | result
|
version | result
|
||||||
${'1.2.3'} | ${3}
|
${'1.2.3'} | ${3}
|
||||||
${'5.2.1'} | ${1}
|
${'5.2.1'} | ${1}
|
||||||
|
@ -780,7 +780,7 @@ describe('modules/versioning/conan/index', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
// equals(version: string, other: string): boolean;
|
// equals(version: string, other: string): boolean;
|
||||||
test.each`
|
it.each`
|
||||||
version | other | result
|
version | other | result
|
||||||
${'1.2.3'} | ${'1.2.3'} | ${true}
|
${'1.2.3'} | ${'1.2.3'} | ${true}
|
||||||
${'2.3.1'} | ${'1.2.3'} | ${false}
|
${'2.3.1'} | ${'1.2.3'} | ${false}
|
||||||
|
@ -831,7 +831,7 @@ describe('modules/versioning/conan/index', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
// isGreaterThan(version: string, other: string): boolean;
|
// isGreaterThan(version: string, other: string): boolean;
|
||||||
test.each`
|
it.each`
|
||||||
version | other | result
|
version | other | result
|
||||||
${'1.2.3'} | ${'1.2.3'} | ${false}
|
${'1.2.3'} | ${'1.2.3'} | ${false}
|
||||||
${'19.00'} | ${'16.00'} | ${true}
|
${'19.00'} | ${'16.00'} | ${true}
|
||||||
|
@ -877,7 +877,7 @@ describe('modules/versioning/conan/index', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
// sortVersions(version: string, other: string): boolean;
|
// sortVersions(version: string, other: string): boolean;
|
||||||
test.each`
|
it.each`
|
||||||
version | other | result
|
version | other | result
|
||||||
${'1.2'} | ${'1.3'} | ${-1}
|
${'1.2'} | ${'1.3'} | ${-1}
|
||||||
${'1.2.3'} | ${'1.2.3'} | ${0}
|
${'1.2.3'} | ${'1.2.3'} | ${0}
|
||||||
|
@ -892,7 +892,7 @@ describe('modules/versioning/conan/index', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
// isLessThanRange(version: string, range: string): boolean;
|
// isLessThanRange(version: string, range: string): boolean;
|
||||||
test.each`
|
it.each`
|
||||||
version | range | result
|
version | range | result
|
||||||
${'1.2.3'} | ${'[>1.2.3]'} | ${true}
|
${'1.2.3'} | ${'[>1.2.3]'} | ${true}
|
||||||
${'2.3.1'} | ${'[>1.2.3]'} | ${false}
|
${'2.3.1'} | ${'[>1.2.3]'} | ${false}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import deb from '.';
|
import deb from '.';
|
||||||
|
|
||||||
describe('modules/versioning/deb/index', () => {
|
describe('modules/versioning/deb/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.1'} | ${true}
|
${'1.1'} | ${true}
|
||||||
${'1.3.RC2'} | ${true}
|
${'1.3.RC2'} | ${true}
|
||||||
|
@ -57,7 +57,7 @@ describe('modules/versioning/deb/index', () => {
|
||||||
expect(deb.isValid(version)).toBe(expected);
|
expect(deb.isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'2.4'} | ${'2.4'} | ${true}
|
${'2.4'} | ${'2.4'} | ${true}
|
||||||
${'2.4.0'} | ${'2.4.0'} | ${true}
|
${'2.4.0'} | ${'2.4.0'} | ${true}
|
||||||
|
@ -81,7 +81,7 @@ describe('modules/versioning/deb/index', () => {
|
||||||
expect(deb.equals(a, b)).toBe(expected);
|
expect(deb.equals(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'2.4.0'} | ${'2.4'} | ${true}
|
${'2.4.0'} | ${'2.4'} | ${true}
|
||||||
${'2.4.2'} | ${'2.4.1'} | ${true}
|
${'2.4.2'} | ${'2.4.1'} | ${true}
|
||||||
|
@ -125,7 +125,7 @@ describe('modules/versioning/deb/index', () => {
|
||||||
expect(deb.isGreaterThan(a, b)).toBe(expected);
|
expect(deb.isGreaterThan(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.0'} | ${true}
|
${'1.2.0'} | ${true}
|
||||||
${'^1.2.0'} | ${false}
|
${'^1.2.0'} | ${false}
|
||||||
|
@ -133,7 +133,7 @@ describe('modules/versioning/deb/index', () => {
|
||||||
expect(deb.isSingleVersion(version)).toBe(expected);
|
expect(deb.isSingleVersion(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'v1.3.0'} | ${1}
|
${'v1.3.0'} | ${1}
|
||||||
${'2-0-1'} | ${2}
|
${'2-0-1'} | ${2}
|
||||||
|
@ -146,7 +146,7 @@ describe('modules/versioning/deb/index', () => {
|
||||||
expect(deb.getMajor(version)).toBe(expected);
|
expect(deb.getMajor(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'v1.3.0'} | ${3}
|
${'v1.3.0'} | ${3}
|
||||||
${'2-0-1'} | ${0}
|
${'2-0-1'} | ${0}
|
||||||
|
@ -159,7 +159,7 @@ describe('modules/versioning/deb/index', () => {
|
||||||
expect(deb.getMinor(version)).toBe(expected);
|
expect(deb.getMinor(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'v1.3.0'} | ${0}
|
${'v1.3.0'} | ${0}
|
||||||
${'2-0-1'} | ${1}
|
${'2-0-1'} | ${1}
|
||||||
|
|
|
@ -2,7 +2,7 @@ import semver from '../semver';
|
||||||
import docker from '.';
|
import docker from '.';
|
||||||
|
|
||||||
describe('modules/versioning/docker/index', () => {
|
describe('modules/versioning/docker/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${null} | ${false}
|
${null} | ${false}
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
|
@ -24,7 +24,7 @@ describe('modules/versioning/docker/index', () => {
|
||||||
expect(!!res).toBe(expected);
|
expect(!!res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | major | minor | patch
|
version | major | minor | patch
|
||||||
${'1.2.3'} | ${1} | ${2} | ${3}
|
${'1.2.3'} | ${1} | ${2} | ${3}
|
||||||
${'18.04'} | ${18} | ${4} | ${null}
|
${'18.04'} | ${18} | ${4} | ${null}
|
||||||
|
@ -40,7 +40,7 @@ describe('modules/versioning/docker/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'1.2.3'} | ${'1.2'} | ${false}
|
${'1.2.3'} | ${'1.2'} | ${false}
|
||||||
${'18.04'} | ${'18.1'} | ${true}
|
${'18.04'} | ${'18.1'} | ${true}
|
||||||
|
@ -51,7 +51,7 @@ describe('modules/versioning/docker/index', () => {
|
||||||
expect(docker.isGreaterThan(a, b)).toBe(expected);
|
expect(docker.isGreaterThan(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'1.2.3'} | ${'2.0'} | ${true}
|
${'1.2.3'} | ${'2.0'} | ${true}
|
||||||
${'18.04'} | ${'18.1'} | ${false}
|
${'18.04'} | ${'18.1'} | ${false}
|
||||||
|
@ -65,7 +65,7 @@ describe('modules/versioning/docker/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'1.2.3'} | ${'1.2.3'} | ${true}
|
${'1.2.3'} | ${'1.2.3'} | ${true}
|
||||||
${'18.04'} | ${'18.4'} | ${true}
|
${'18.04'} | ${'18.4'} | ${true}
|
||||||
|
@ -89,7 +89,7 @@ describe('modules/versioning/docker/index', () => {
|
||||||
'2',
|
'2',
|
||||||
];
|
];
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.3'} | ${'1.2.3'}
|
${'1.2.3'} | ${'1.2.3'}
|
||||||
${'1.2'} | ${'1.2'}
|
${'1.2'} | ${'1.2'}
|
||||||
|
@ -105,7 +105,7 @@ describe('modules/versioning/docker/index', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('sortVersions(v1, v2)', () => {
|
describe('sortVersions(v1, v2)', () => {
|
||||||
test.each`
|
it.each`
|
||||||
a | b
|
a | b
|
||||||
${'1.1.1'} | ${'1.2.3'}
|
${'1.1.1'} | ${'1.2.3'}
|
||||||
${'1.2.3'} | ${'1.3.4'}
|
${'1.2.3'} | ${'1.3.4'}
|
||||||
|
@ -145,7 +145,7 @@ describe('modules/versioning/docker/index', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${null} | ${null} | ${null} | ${'1.2.3'} | ${'1.2.3'}
|
${null} | ${null} | ${null} | ${'1.2.3'} | ${'1.2.3'}
|
||||||
`(
|
`(
|
||||||
|
@ -161,7 +161,7 @@ describe('modules/versioning/docker/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'3.7.0'} | ${true}
|
${'3.7.0'} | ${true}
|
||||||
${'3.7.0b1'} | ${false}
|
${'3.7.0b1'} | ${false}
|
||||||
|
@ -174,7 +174,7 @@ describe('modules/versioning/docker/index', () => {
|
||||||
expect(!!res).toBe(expected);
|
expect(!!res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'3.7.0'} | ${'3.7.0'} | ${true}
|
${'3.7.0'} | ${'3.7.0'} | ${true}
|
||||||
${'3.7.0b1'} | ${'3.7.0'} | ${true}
|
${'3.7.0b1'} | ${'3.7.0'} | ${true}
|
||||||
|
@ -196,7 +196,7 @@ describe('modules/versioning/docker/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
value | expected
|
value | expected
|
||||||
${'3.7.0'} | ${'3.7.0'}
|
${'3.7.0'} | ${'3.7.0'}
|
||||||
${'3.7.0b1'} | ${'3.7.0b1'}
|
${'3.7.0b1'} | ${'3.7.0b1'}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import git from '.';
|
import git from '.';
|
||||||
|
|
||||||
describe('modules/versioning/git/index', () => {
|
describe('modules/versioning/git/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${''} | ${false}
|
${''} | ${false}
|
||||||
${'2'} | ${false}
|
${'2'} | ${false}
|
||||||
|
@ -17,7 +17,7 @@ describe('modules/versioning/git/index', () => {
|
||||||
expect(git.isValid(input)).toBe(expected);
|
expect(git.isValid(input)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${''} | ${''} | ${false}
|
${''} | ${''} | ${false}
|
||||||
${'1234567890aBcDeF'} | ${''} | ${true}
|
${'1234567890aBcDeF'} | ${''} | ${true}
|
||||||
|
@ -29,7 +29,7 @@ describe('modules/versioning/git/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${''} | ${''} | ${false}
|
${''} | ${''} | ${false}
|
||||||
${'abc'} | ${'bca'} | ${false}
|
${'abc'} | ${'bca'} | ${false}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { api as semver } from '.';
|
import { api as semver } from '.';
|
||||||
|
|
||||||
describe('modules/versioning/go-mod-directive/index', () => {
|
describe('modules/versioning/go-mod-directive/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'1.16.0'} | ${'1.16'} | ${true}
|
${'1.16.0'} | ${'1.16'} | ${true}
|
||||||
${'1.16.1'} | ${'1.16'} | ${true}
|
${'1.16.1'} | ${'1.16'} | ${true}
|
||||||
|
@ -15,7 +15,7 @@ describe('modules/versioning/go-mod-directive/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['1.16.0', '1.16.1', '1.17.0']} | ${'1.16'} | ${'1.17.0'}
|
${['1.16.0', '1.16.1', '1.17.0']} | ${'1.16'} | ${'1.17.0'}
|
||||||
`(
|
`(
|
||||||
|
@ -25,7 +25,7 @@ describe('modules/versioning/go-mod-directive/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1'} | ${false}
|
${'1'} | ${false}
|
||||||
${'1.2'} | ${true}
|
${'1.2'} | ${true}
|
||||||
|
@ -34,7 +34,7 @@ describe('modules/versioning/go-mod-directive/index', () => {
|
||||||
expect(!!semver.isValid(version)).toBe(expected);
|
expect(!!semver.isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1'} | ${false}
|
${'1'} | ${false}
|
||||||
${'1.2'} | ${false}
|
${'1.2'} | ${false}
|
||||||
|
@ -43,7 +43,7 @@ describe('modules/versioning/go-mod-directive/index', () => {
|
||||||
expect(!!semver.isVersion(version)).toBe(expected);
|
expect(!!semver.isVersion(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'1.15.0'} | ${'1.16'} | ${true}
|
${'1.15.0'} | ${'1.16'} | ${true}
|
||||||
${'1.19.0'} | ${'1.16'} | ${false}
|
${'1.19.0'} | ${'1.16'} | ${false}
|
||||||
|
@ -54,7 +54,7 @@ describe('modules/versioning/go-mod-directive/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['1.15.0', '1.16.0', '1.16.1']} | ${'1.16'} | ${'1.16.0'}
|
${['1.15.0', '1.16.0', '1.16.1']} | ${'1.16'} | ${'1.16.0'}
|
||||||
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'1.16'} | ${null}
|
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'1.16'} | ${null}
|
||||||
|
@ -65,7 +65,7 @@ describe('modules/versioning/go-mod-directive/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'1.16'} | ${'bump'} | ${'1.16.4'} | ${'1.17.0'} | ${'1.17'}
|
${'1.16'} | ${'bump'} | ${'1.16.4'} | ${'1.17.0'} | ${'1.17'}
|
||||||
${'1.16'} | ${'bump'} | ${'1.16.4'} | ${'1.16.4'} | ${'1.16'}
|
${'1.16'} | ${'bump'} | ${'1.16.4'} | ${'1.16.4'} | ${'1.16'}
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { compare, parseMavenBasedRange, parsePrefixRange } from './compare';
|
||||||
import { api } from '.';
|
import { api } from '.';
|
||||||
|
|
||||||
describe('modules/versioning/gradle/index', () => {
|
describe('modules/versioning/gradle/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'1'} | ${'1'} | ${0}
|
${'1'} | ${'1'} | ${0}
|
||||||
${'a'} | ${'a'} | ${0}
|
${'a'} | ${'a'} | ${0}
|
||||||
|
@ -80,7 +80,7 @@ describe('modules/versioning/gradle/index', () => {
|
||||||
expect(compare(a, b)).toEqual(expected);
|
expect(compare(a, b)).toEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
rangeStr
|
rangeStr
|
||||||
${''}
|
${''}
|
||||||
${'1.2.3-SNAPSHOT'}
|
${'1.2.3-SNAPSHOT'}
|
||||||
|
@ -91,7 +91,7 @@ describe('modules/versioning/gradle/index', () => {
|
||||||
expect(range).toBeNull();
|
expect(range).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
rangeStr
|
rangeStr
|
||||||
${''}
|
${''}
|
||||||
${'1.2.3-SNAPSHOT'}
|
${'1.2.3-SNAPSHOT'}
|
||||||
|
@ -113,7 +113,7 @@ describe('modules/versioning/gradle/index', () => {
|
||||||
expect(range).toBeNull();
|
expect(range).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${'1.0.0'} | ${true}
|
${'1.0.0'} | ${true}
|
||||||
${'[1.12.6,1.18.6]'} | ${true}
|
${'[1.12.6,1.18.6]'} | ${true}
|
||||||
|
@ -122,7 +122,7 @@ describe('modules/versioning/gradle/index', () => {
|
||||||
expect(api.isValid(input)).toBe(expected);
|
expect(api.isValid(input)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${''} | ${false}
|
${''} | ${false}
|
||||||
${'latest.integration'} | ${false}
|
${'latest.integration'} | ${false}
|
||||||
|
@ -152,7 +152,7 @@ describe('modules/versioning/gradle/index', () => {
|
||||||
expect(api.isVersion(input)).toBe(expected);
|
expect(api.isVersion(input)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${''} | ${false}
|
${''} | ${false}
|
||||||
${'latest'} | ${false}
|
${'latest'} | ${false}
|
||||||
|
@ -186,7 +186,7 @@ describe('modules/versioning/gradle/index', () => {
|
||||||
expect(api.isStable(input)).toBe(expected);
|
expect(api.isStable(input)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | major | minor | patch
|
input | major | minor | patch
|
||||||
${''} | ${null} | ${null} | ${null}
|
${''} | ${null} | ${null} | ${null}
|
||||||
${'1'} | ${1} | ${0} | ${0}
|
${'1'} | ${1} | ${0} | ${0}
|
||||||
|
@ -207,7 +207,7 @@ describe('modules/versioning/gradle/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'1'} | ${'[[]]'} | ${false}
|
${'1'} | ${'[[]]'} | ${false}
|
||||||
${'0'} | ${'[0,1]'} | ${true}
|
${'0'} | ${'[0,1]'} | ${true}
|
||||||
|
@ -235,14 +235,14 @@ describe('modules/versioning/gradle/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'1.1'} | ${'1'} | ${true}
|
${'1.1'} | ${'1'} | ${true}
|
||||||
`('isGreaterThan("$a", "$b") === $expected', ({ a, b, expected }) => {
|
`('isGreaterThan("$a", "$b") === $expected', ({ a, b, expected }) => {
|
||||||
expect(api.isGreaterThan(a, b)).toBe(expected);
|
expect(api.isGreaterThan(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['0', '1.5', '1', '2']} | ${'1.+'} | ${'1'}
|
${['0', '1.5', '1', '2']} | ${'1.+'} | ${'1'}
|
||||||
`(
|
`(
|
||||||
|
@ -252,7 +252,7 @@ describe('modules/versioning/gradle/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['0', '1', '1.5', '2']} | ${'1.+'} | ${'1.5'}
|
${['0', '1', '1.5', '2']} | ${'1.+'} | ${'1.5'}
|
||||||
`(
|
`(
|
||||||
|
@ -262,7 +262,7 @@ describe('modules/versioning/gradle/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'1'} | ${null} | ${null} | ${'1.1'} | ${'1.1'}
|
${'1'} | ${null} | ${null} | ${'1.1'} | ${'1.1'}
|
||||||
${'[1.2.3,]'} | ${null} | ${null} | ${'1.2.4'} | ${null}
|
${'[1.2.3,]'} | ${null} | ${null} | ${'1.2.4'} | ${null}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { hashicorp2npm, npm2hashicorp } from './convertor';
|
import { hashicorp2npm, npm2hashicorp } from './convertor';
|
||||||
|
|
||||||
describe('modules/versioning/hashicorp/convertor', () => {
|
describe('modules/versioning/hashicorp/convertor', () => {
|
||||||
test.each`
|
it.each`
|
||||||
hashicorp | npm
|
hashicorp | npm
|
||||||
${''} | ${''}
|
${''} | ${''}
|
||||||
${'4.2.0'} | ${'4.2.0'}
|
${'4.2.0'} | ${'4.2.0'}
|
||||||
|
@ -29,7 +29,7 @@ describe('modules/versioning/hashicorp/convertor', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
// These are non-reflective cases for hashicorp2npm
|
// These are non-reflective cases for hashicorp2npm
|
||||||
test.each`
|
it.each`
|
||||||
hashicorp | npm
|
hashicorp | npm
|
||||||
${'~> 4'} | ${'>=4'}
|
${'~> 4'} | ${'>=4'}
|
||||||
${'~> v4'} | ${'>=4'}
|
${'~> v4'} | ${'>=4'}
|
||||||
|
@ -43,7 +43,7 @@ describe('modules/versioning/hashicorp/convertor', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
// These are non-reflective cases for npm2hashicorp
|
// These are non-reflective cases for npm2hashicorp
|
||||||
test.each`
|
it.each`
|
||||||
hashicorp | npm
|
hashicorp | npm
|
||||||
${'~> 4.0'} | ${'^4'}
|
${'~> 4.0'} | ${'^4'}
|
||||||
${'~> 4.0'} | ${'^4.0.0'}
|
${'~> 4.0'} | ${'^4.0.0'}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { api as semver } from '.';
|
import { api as semver } from '.';
|
||||||
|
|
||||||
describe('modules/versioning/hashicorp/index', () => {
|
describe('modules/versioning/hashicorp/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'4.2.0'} | ${'~> 4.0'} | ${true}
|
${'4.2.0'} | ${'~> 4.0'} | ${true}
|
||||||
${'4.2.0'} | ${'~> 4.0.0'} | ${false}
|
${'4.2.0'} | ${'~> 4.0.0'} | ${false}
|
||||||
|
@ -12,7 +12,7 @@ describe('modules/versioning/hashicorp/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'~> 4.0'} | ${'4.2.0'}
|
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'~> 4.0'} | ${'4.2.0'}
|
||||||
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'~> 4.0.0'} | ${'4.0.0'}
|
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'~> 4.0.0'} | ${'4.0.0'}
|
||||||
|
@ -23,7 +23,7 @@ describe('modules/versioning/hashicorp/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${'>= 1.0.0, <= 2.0.0'} | ${true}
|
${'>= 1.0.0, <= 2.0.0'} | ${true}
|
||||||
${'~> 4'} | ${true}
|
${'~> 4'} | ${true}
|
||||||
|
@ -42,7 +42,7 @@ describe('modules/versioning/hashicorp/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'0.9.0'} | ${'>= 1.0.0, <= 2.0.0'} | ${true}
|
${'0.9.0'} | ${'>= 1.0.0, <= 2.0.0'} | ${true}
|
||||||
${'1.9.0'} | ${'>= 1.0.0, <= 2.0.0'} | ${false}
|
${'1.9.0'} | ${'>= 1.0.0, <= 2.0.0'} | ${false}
|
||||||
|
@ -53,7 +53,7 @@ describe('modules/versioning/hashicorp/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'~> 4.0'} | ${'4.2.0'}
|
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'~> 4.0'} | ${'4.2.0'}
|
||||||
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'~> 4.0.0'} | ${null}
|
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'~> 4.0.0'} | ${null}
|
||||||
|
@ -64,7 +64,7 @@ describe('modules/versioning/hashicorp/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'~> 1.2'} | ${'replace'} | ${'1.2.3'} | ${'2.0.7'} | ${'~> 2.0'}
|
${'~> 1.2'} | ${'replace'} | ${'1.2.3'} | ${'2.0.7'} | ${'~> 2.0'}
|
||||||
${'~> 1.2.0'} | ${'replace'} | ${'1.2.3'} | ${'2.0.7'} | ${'~> 2.0.0'}
|
${'~> 1.2.0'} | ${'replace'} | ${'1.2.3'} | ${'2.0.7'} | ${'~> 2.0.0'}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { api as semver } from '.';
|
import { api as semver } from '.';
|
||||||
|
|
||||||
describe('modules/versioning/helm/index', () => {
|
describe('modules/versioning/helm/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
version | isValid
|
version | isValid
|
||||||
${'17.04.0'} | ${false}
|
${'17.04.0'} | ${false}
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
|
@ -19,7 +19,7 @@ describe('modules/versioning/helm/index', () => {
|
||||||
expect(res).toBe(isValid);
|
expect(res).toBe(isValid);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | isSingle
|
version | isSingle
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
${'1.2.3-alpha.1'} | ${true}
|
${'1.2.3-alpha.1'} | ${true}
|
||||||
|
@ -31,7 +31,7 @@ describe('modules/versioning/helm/index', () => {
|
||||||
expect(res).toBe(isSingle);
|
expect(res).toBe(isSingle);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'=1.0.0'} | ${'bump'} | ${'1.0.0'} | ${'1.1.0'} | ${'=1.1.0'}
|
${'=1.0.0'} | ${'bump'} | ${'1.0.0'} | ${'1.1.0'} | ${'=1.1.0'}
|
||||||
${'^1.0'} | ${'bump'} | ${'1.0.0'} | ${'1.0.7'} | ${'^1.0.7'}
|
${'^1.0'} | ${'bump'} | ${'1.0.0'} | ${'1.0.7'} | ${'^1.0.7'}
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { HermitVersioning } from './index';
|
||||||
describe('modules/versioning/hermit/index', () => {
|
describe('modules/versioning/hermit/index', () => {
|
||||||
const versioning = new HermitVersioning();
|
const versioning = new HermitVersioning();
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1'} | ${true}
|
${'1'} | ${true}
|
||||||
${'1.2'} | ${true}
|
${'1.2'} | ${true}
|
||||||
|
@ -16,7 +16,7 @@ describe('modules/versioning/hermit/index', () => {
|
||||||
expect(versioning.isStable(version)).toBe(expected);
|
expect(versioning.isStable(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1'} | ${true}
|
${'1'} | ${true}
|
||||||
${'1rc1'} | ${true}
|
${'1rc1'} | ${true}
|
||||||
|
@ -43,7 +43,7 @@ describe('modules/versioning/hermit/index', () => {
|
||||||
expect(versioning.isValid(version)).toBe(expected);
|
expect(versioning.isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | major | minor | patch
|
version | major | minor | patch
|
||||||
${'17'} | ${17} | ${0} | ${0}
|
${'17'} | ${17} | ${0} | ${0}
|
||||||
${'17.2'} | ${17} | ${2} | ${0}
|
${'17.2'} | ${17} | ${2} | ${0}
|
||||||
|
@ -62,7 +62,7 @@ describe('modules/versioning/hermit/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | other | expected
|
version | other | expected
|
||||||
${'1'} | ${'1.2'} | ${false}
|
${'1'} | ${'1.2'} | ${false}
|
||||||
${'@1'} | ${'@1.2'} | ${false}
|
${'@1'} | ${'@1.2'} | ${false}
|
||||||
|
@ -80,7 +80,7 @@ describe('modules/versioning/hermit/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'0.6.1'} | ${'>0.6.0 <0.7.0'} | ${true}
|
${'0.6.1'} | ${'>0.6.0 <0.7.0'} | ${true}
|
||||||
${'0.6.1'} | ${'<0.7.0'} | ${true}
|
${'0.6.1'} | ${'<0.7.0'} | ${true}
|
||||||
|
@ -107,7 +107,7 @@ describe('modules/versioning/hermit/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | other | expected
|
version | other | expected
|
||||||
${'@1'} | ${'@1.2'} | ${true}
|
${'@1'} | ${'@1.2'} | ${true}
|
||||||
${'@1.2'} | ${'@1.2'} | ${false}
|
${'@1.2'} | ${'@1.2'} | ${false}
|
||||||
|
@ -136,7 +136,7 @@ describe('modules/versioning/hermit/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | other | expected
|
version | other | expected
|
||||||
${'@1'} | ${'@1.2'} | ${false}
|
${'@1'} | ${'@1.2'} | ${false}
|
||||||
${'@1.2'} | ${'@1.2'} | ${false}
|
${'@1.2'} | ${'@1.2'} | ${false}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { api as hexScheme } from '.';
|
import { api as hexScheme } from '.';
|
||||||
|
|
||||||
describe('modules/versioning/hex/index', () => {
|
describe('modules/versioning/hex/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'4.2.0'} | ${'~> 4.0'} | ${true}
|
${'4.2.0'} | ${'~> 4.0'} | ${true}
|
||||||
${'2.1.0'} | ${'~> 2.0.0'} | ${false}
|
${'2.1.0'} | ${'~> 2.0.0'} | ${false}
|
||||||
|
@ -16,7 +16,7 @@ describe('modules/versioning/hex/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'~> 4.0'} | ${'4.2.0'}
|
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'~> 4.0'} | ${'4.2.0'}
|
||||||
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'~> 4.0.0'} | ${'4.0.0'}
|
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'~> 4.0.0'} | ${'4.0.0'}
|
||||||
|
@ -27,7 +27,7 @@ describe('modules/versioning/hex/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${'>= 1.0.0 and <= 2.0.0'} | ${true}
|
${'>= 1.0.0 and <= 2.0.0'} | ${true}
|
||||||
${'>= 1.0.0 or <= 2.0.0'} | ${true}
|
${'>= 1.0.0 or <= 2.0.0'} | ${true}
|
||||||
|
@ -38,7 +38,7 @@ describe('modules/versioning/hex/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'0.1.0'} | ${'>= 1.0.0 and <= 2.0.0'} | ${true}
|
${'0.1.0'} | ${'>= 1.0.0 and <= 2.0.0'} | ${true}
|
||||||
${'1.9.0'} | ${'>= 1.0.0 and <= 2.0.0'} | ${false}
|
${'1.9.0'} | ${'>= 1.0.0 and <= 2.0.0'} | ${false}
|
||||||
|
@ -51,7 +51,7 @@ describe('modules/versioning/hex/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'~> 4.0'} | ${'4.2.0'}
|
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'~> 4.0'} | ${'4.2.0'}
|
||||||
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'~> 4.0.0'} | ${null}
|
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'~> 4.0.0'} | ${null}
|
||||||
|
@ -62,7 +62,7 @@ describe('modules/versioning/hex/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'== 1.2.3'} | ${'pin'} | ${'1.2.3'} | ${'2.0.7'} | ${'== 2.0.7'}
|
${'== 1.2.3'} | ${'pin'} | ${'1.2.3'} | ${'2.0.7'} | ${'== 2.0.7'}
|
||||||
${'== 3.6.1'} | ${'bump'} | ${'3.6.1'} | ${'3.6.2'} | ${'== 3.6.2'}
|
${'== 3.6.1'} | ${'bump'} | ${'3.6.1'} | ${'3.6.2'} | ${'== 3.6.2'}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {
|
||||||
import ivy from '.';
|
import ivy from '.';
|
||||||
|
|
||||||
describe('modules/versioning/ivy/index', () => {
|
describe('modules/versioning/ivy/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input | type | value
|
input | type | value
|
||||||
${'latest'} | ${REV_TYPE_LATEST} | ${''}
|
${'latest'} | ${REV_TYPE_LATEST} | ${''}
|
||||||
${'latest.release'} | ${REV_TYPE_LATEST} | ${'release'}
|
${'latest.release'} | ${REV_TYPE_LATEST} | ${'release'}
|
||||||
|
@ -30,7 +30,7 @@ describe('modules/versioning/ivy/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input
|
input
|
||||||
${null}
|
${null}
|
||||||
${''}
|
${''}
|
||||||
|
@ -40,7 +40,7 @@ describe('modules/versioning/ivy/index', () => {
|
||||||
expect(parseDynamicRevision(value)).toBeNull();
|
expect(parseDynamicRevision(value)).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${''} | ${false}
|
${''} | ${false}
|
||||||
${'1.0.0'} | ${true}
|
${'1.0.0'} | ${true}
|
||||||
|
@ -69,7 +69,7 @@ describe('modules/versioning/ivy/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${''} | ${false}
|
${''} | ${false}
|
||||||
${'1.0.0'} | ${true}
|
${'1.0.0'} | ${true}
|
||||||
|
@ -97,7 +97,7 @@ describe('modules/versioning/ivy/index', () => {
|
||||||
expect(ivy.isVersion(input)).toBe(expected);
|
expect(ivy.isVersion(input)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${''} | ${'latest'} | ${false}
|
${''} | ${'latest'} | ${false}
|
||||||
${'0'} | ${''} | ${false}
|
${'0'} | ${''} | ${false}
|
||||||
|
@ -140,7 +140,7 @@ describe('modules/versioning/ivy/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'1'} | ${'auto'} | ${'1'} | ${'1.1'} | ${'1.1'}
|
${'1'} | ${'auto'} | ${'1'} | ${'1.1'} | ${'1.1'}
|
||||||
${'[1.2.3,]'} | ${'auto'} | ${'1.2.3'} | ${'1.2.4'} | ${'[1.2.3,]'}
|
${'[1.2.3,]'} | ${'auto'} | ${'1.2.3'} | ${'1.2.4'} | ${'[1.2.3,]'}
|
||||||
|
@ -170,7 +170,7 @@ describe('modules/versioning/ivy/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['0', '1', '2']} | ${'(,2)'} | ${'1'}
|
${['0', '1', '2']} | ${'(,2)'} | ${'1'}
|
||||||
`(
|
`(
|
||||||
|
@ -180,14 +180,14 @@ describe('modules/versioning/ivy/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.0'} | ${true}
|
${'1.2.0'} | ${true}
|
||||||
`('isCompatible("$version") === $expected', ({ version, expected }) => {
|
`('isCompatible("$version") === $expected', ({ version, expected }) => {
|
||||||
expect(ivy.isCompatible(version)).toBe(expected);
|
expect(ivy.isCompatible(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.0'} | ${true}
|
${'1.2.0'} | ${true}
|
||||||
${'^1.2.0'} | ${false}
|
${'^1.2.0'} | ${false}
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { KubernetesApiVersioningApi } from './index';
|
||||||
describe('modules/versioning/kubernetes-api/index', () => {
|
describe('modules/versioning/kubernetes-api/index', () => {
|
||||||
const versioning = new KubernetesApiVersioningApi();
|
const versioning = new KubernetesApiVersioningApi();
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'v1'} | ${true}
|
${'v1'} | ${true}
|
||||||
${'v2'} | ${true}
|
${'v2'} | ${true}
|
||||||
|
@ -13,7 +13,7 @@ describe('modules/versioning/kubernetes-api/index', () => {
|
||||||
expect(versioning.isStable(version)).toBe(expected);
|
expect(versioning.isStable(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'v1'} | ${true}
|
${'v1'} | ${true}
|
||||||
${'v2'} | ${true}
|
${'v2'} | ${true}
|
||||||
|
@ -34,7 +34,7 @@ describe('modules/versioning/kubernetes-api/index', () => {
|
||||||
expect(versioning.isValid(version)).toBe(expected);
|
expect(versioning.isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | major | minor | patch
|
version | major | minor | patch
|
||||||
${'v1'} | ${1} | ${0} | ${0}
|
${'v1'} | ${1} | ${0} | ${0}
|
||||||
${'v2'} | ${2} | ${0} | ${0}
|
${'v2'} | ${2} | ${0} | ${0}
|
||||||
|
@ -51,7 +51,7 @@ describe('modules/versioning/kubernetes-api/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | other | expected
|
version | other | expected
|
||||||
${'v1'} | ${'v1'} | ${true}
|
${'v1'} | ${'v1'} | ${true}
|
||||||
${'v1'} | ${'v2'} | ${false}
|
${'v1'} | ${'v2'} | ${false}
|
||||||
|
@ -78,7 +78,7 @@ describe('modules/versioning/kubernetes-api/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | other | expected
|
version | other | expected
|
||||||
${'v1'} | ${'v1'} | ${true}
|
${'v1'} | ${'v1'} | ${true}
|
||||||
${'v1'} | ${'v2'} | ${false}
|
${'v1'} | ${'v2'} | ${false}
|
||||||
|
@ -97,7 +97,7 @@ describe('modules/versioning/kubernetes-api/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | other | expected
|
version | other | expected
|
||||||
${'v1'} | ${'v2'} | ${false}
|
${'v1'} | ${'v2'} | ${false}
|
||||||
${'v1'} | ${'v1alpha1'} | ${true}
|
${'v1'} | ${'v1alpha1'} | ${true}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import loose from '.';
|
import loose from '.';
|
||||||
|
|
||||||
describe('modules/versioning/loose/index', () => {
|
describe('modules/versioning/loose/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.1'} | ${true}
|
${'1.1'} | ${true}
|
||||||
${'1.3.RC2'} | ${true}
|
${'1.3.RC2'} | ${true}
|
||||||
|
@ -10,7 +10,7 @@ describe('modules/versioning/loose/index', () => {
|
||||||
expect(!!loose.isVersion(version)).toBe(expected);
|
expect(!!loose.isVersion(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'v1.4'} | ${true}
|
${'v1.4'} | ${true}
|
||||||
${'3.5.0'} | ${true}
|
${'3.5.0'} | ${true}
|
||||||
|
@ -37,7 +37,7 @@ describe('modules/versioning/loose/index', () => {
|
||||||
expect(!!loose.isValid(version)).toBe(expected);
|
expect(!!loose.isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'2.4'} | ${'2.4'} | ${true}
|
${'2.4'} | ${'2.4'} | ${true}
|
||||||
${'2.4.0'} | ${'2.4.0'} | ${true}
|
${'2.4.0'} | ${'2.4.0'} | ${true}
|
||||||
|
@ -48,7 +48,7 @@ describe('modules/versioning/loose/index', () => {
|
||||||
expect(loose.equals(a, b)).toBe(expected);
|
expect(loose.equals(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'2.4.0'} | ${'2.4'} | ${true}
|
${'2.4.0'} | ${'2.4'} | ${true}
|
||||||
${'2.4.2'} | ${'2.4.1'} | ${true}
|
${'2.4.2'} | ${'2.4.1'} | ${true}
|
||||||
|
@ -63,14 +63,14 @@ describe('modules/versioning/loose/index', () => {
|
||||||
expect(loose.isGreaterThan(a, b)).toBe(expected);
|
expect(loose.isGreaterThan(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.0'} | ${true}
|
${'1.2.0'} | ${true}
|
||||||
`('isCompatible("$version") === $expected', ({ version, expected }) => {
|
`('isCompatible("$version") === $expected', ({ version, expected }) => {
|
||||||
expect(loose.isCompatible(version)).toBe(expected);
|
expect(loose.isCompatible(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.0'} | ${true}
|
${'1.2.0'} | ${true}
|
||||||
${'^1.2.0'} | ${false}
|
${'^1.2.0'} | ${false}
|
||||||
|
|
|
@ -10,7 +10,7 @@ describe('modules/versioning/maven/compare', () => {
|
||||||
// @see https://github.com/apache/maven/blob/master/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java
|
// @see https://github.com/apache/maven/blob/master/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java
|
||||||
// @see https://github.com/apache/maven/blob/master/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/DefaultArtifactVersionTest.java
|
// @see https://github.com/apache/maven/blob/master/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/DefaultArtifactVersionTest.java
|
||||||
describe('equality', () => {
|
describe('equality', () => {
|
||||||
test.each`
|
it.each`
|
||||||
x | y
|
x | y
|
||||||
${'1'} | ${'1'}
|
${'1'} | ${'1'}
|
||||||
${'1'} | ${'1.0'}
|
${'1'} | ${'1.0'}
|
||||||
|
@ -99,7 +99,7 @@ describe('modules/versioning/maven/compare', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('ordering', () => {
|
describe('ordering', () => {
|
||||||
test.each`
|
it.each`
|
||||||
x | y
|
x | y
|
||||||
${'1'} | ${'2'}
|
${'1'} | ${'2'}
|
||||||
${'1.5'} | ${'2'}
|
${'1.5'} | ${'2'}
|
||||||
|
@ -197,7 +197,7 @@ describe('modules/versioning/maven/compare', () => {
|
||||||
|
|
||||||
describe('Non-standard behavior', () => {
|
describe('Non-standard behavior', () => {
|
||||||
describe('equality', () => {
|
describe('equality', () => {
|
||||||
test.each`
|
it.each`
|
||||||
x | y
|
x | y
|
||||||
${'1-ga-1'} | ${'1-1'}
|
${'1-ga-1'} | ${'1-1'}
|
||||||
${'1.0-SNAP'} | ${'1-snapshot'}
|
${'1.0-SNAP'} | ${'1-snapshot'}
|
||||||
|
@ -212,7 +212,7 @@ describe('modules/versioning/maven/compare', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('ordering', () => {
|
describe('ordering', () => {
|
||||||
test.each`
|
it.each`
|
||||||
x | y
|
x | y
|
||||||
${'1-snap'} | ${'1'}
|
${'1-snap'} | ${'1'}
|
||||||
${'1-preview'} | ${'1-snapshot'}
|
${'1-preview'} | ${'1-snapshot'}
|
||||||
|
@ -224,7 +224,7 @@ describe('modules/versioning/maven/compare', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Ranges', () => {
|
describe('Ranges', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input
|
input
|
||||||
${'1.2.3-SNAPSHOT'}
|
${'1.2.3-SNAPSHOT'}
|
||||||
${'[]'}
|
${'[]'}
|
||||||
|
@ -255,7 +255,7 @@ describe('modules/versioning/maven/compare', () => {
|
||||||
expect(rangeToStr(range)).toBeNull();
|
expect(rangeToStr(range)).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | leftType | leftValue | leftBracket | rightType | rightValue | rightBracket
|
input | leftType | leftValue | leftBracket | rightType | rightValue | rightBracket
|
||||||
${'[1.0]'} | ${'INCLUDING_POINT'} | ${'1.0'} | ${'['} | ${'INCLUDING_POINT'} | ${'1.0'} | ${']'}
|
${'[1.0]'} | ${'INCLUDING_POINT'} | ${'1.0'} | ${'['} | ${'INCLUDING_POINT'} | ${'1.0'} | ${']'}
|
||||||
${'(,1.0]'} | ${'EXCLUDING_POINT'} | ${null} | ${'('} | ${'INCLUDING_POINT'} | ${'1.0'} | ${']'}
|
${'(,1.0]'} | ${'EXCLUDING_POINT'} | ${null} | ${'('} | ${'INCLUDING_POINT'} | ${'1.0'} | ${']'}
|
||||||
|
@ -294,7 +294,7 @@ describe('modules/versioning/maven/compare', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
range | version | expected
|
range | version | expected
|
||||||
${'[1.2.3]'} | ${'1.2.3'} | ${'[1.2.3]'}
|
${'[1.2.3]'} | ${'1.2.3'} | ${'[1.2.3]'}
|
||||||
${'[1.2.3]'} | ${'1.2.4'} | ${'[1.2.4]'}
|
${'[1.2.3]'} | ${'1.2.4'} | ${'[1.2.4]'}
|
||||||
|
|
|
@ -8,7 +8,7 @@ describe('modules/versioning/maven/index', () => {
|
||||||
expect(isValid).toBe(_isValid);
|
expect(isValid).toBe(_isValid);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.0.0'} | ${true}
|
${'1.0.0'} | ${true}
|
||||||
${'17.0.5+8'} | ${true}
|
${'17.0.5+8'} | ${true}
|
||||||
|
@ -18,7 +18,7 @@ describe('modules/versioning/maven/index', () => {
|
||||||
expect(!!isValid(version)).toBe(expected);
|
expect(!!isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${''} | ${false}
|
${''} | ${false}
|
||||||
${'1.0.0'} | ${true}
|
${'1.0.0'} | ${true}
|
||||||
|
@ -46,7 +46,7 @@ describe('modules/versioning/maven/index', () => {
|
||||||
expect(!!isVersion(version)).toBe(expected);
|
expect(!!isVersion(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${''} | ${false}
|
${''} | ${false}
|
||||||
${'foobar'} | ${true}
|
${'foobar'} | ${true}
|
||||||
|
@ -75,7 +75,7 @@ describe('modules/versioning/maven/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | major | minor | patch
|
input | major | minor | patch
|
||||||
${''} | ${null} | ${null} | ${null}
|
${''} | ${null} | ${null} | ${null}
|
||||||
${'1'} | ${1} | ${0} | ${0}
|
${'1'} | ${1} | ${0} | ${0}
|
||||||
|
@ -97,7 +97,7 @@ describe('modules/versioning/maven/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'0'} | ${'[0,1]'} | ${true}
|
${'0'} | ${'[0,1]'} | ${true}
|
||||||
${'1'} | ${'[0,1]'} | ${true}
|
${'1'} | ${'[0,1]'} | ${true}
|
||||||
|
@ -125,14 +125,14 @@ describe('modules/versioning/maven/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'1.1'} | ${'1'} | ${true}
|
${'1.1'} | ${'1'} | ${true}
|
||||||
`('isGreaterThan("$a", "$b") === $expected', ({ a, b, expected }) => {
|
`('isGreaterThan("$a", "$b") === $expected', ({ a, b, expected }) => {
|
||||||
expect(maven.isGreaterThan(a, b)).toBe(expected);
|
expect(maven.isGreaterThan(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['1']} | ${'1'} | ${'1'}
|
${['1']} | ${'1'} | ${'1'}
|
||||||
`(
|
`(
|
||||||
|
@ -142,7 +142,7 @@ describe('modules/versioning/maven/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['1']} | ${'1'} | ${'1'}
|
${['1']} | ${'1'} | ${'1'}
|
||||||
`(
|
`(
|
||||||
|
@ -152,7 +152,7 @@ describe('modules/versioning/maven/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'1'} | ${null} | ${null} | ${'1.1'} | ${'1.1'}
|
${'1'} | ${null} | ${null} | ${'1.1'} | ${'1.1'}
|
||||||
${'[1.2.3,]'} | ${null} | ${null} | ${'1.2.4'} | ${'[1.2.3,]'}
|
${'[1.2.3,]'} | ${null} | ${null} | ${'1.2.4'} | ${'[1.2.3,]'}
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { NixPkgsVersioning } from '.';
|
||||||
describe('modules/versioning/nixpkgs/index', () => {
|
describe('modules/versioning/nixpkgs/index', () => {
|
||||||
const versioning = new NixPkgsVersioning();
|
const versioning = new NixPkgsVersioning();
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${undefined} | ${false}
|
${undefined} | ${false}
|
||||||
${null} | ${false}
|
${null} | ${false}
|
||||||
|
@ -29,7 +29,7 @@ describe('modules/versioning/nixpkgs/index', () => {
|
||||||
expect(versioning.isValid(version)).toBe(expected);
|
expect(versioning.isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${undefined} | ${false}
|
${undefined} | ${false}
|
||||||
${null} | ${false}
|
${null} | ${false}
|
||||||
|
@ -46,7 +46,7 @@ describe('modules/versioning/nixpkgs/index', () => {
|
||||||
expect(versioning.isStable(version)).toBe(expected);
|
expect(versioning.isStable(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'nixos-22.05'} | ${'nixos-22.05'} | ${true}
|
${'nixos-22.05'} | ${'nixos-22.05'} | ${true}
|
||||||
${'nixos-22.05'} | ${'nixos-21.11'} | ${false}
|
${'nixos-22.05'} | ${'nixos-21.11'} | ${false}
|
||||||
|
@ -57,7 +57,7 @@ describe('modules/versioning/nixpkgs/index', () => {
|
||||||
expect(versioning.equals(a, b)).toBe(expected);
|
expect(versioning.equals(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | expected
|
versions | expected
|
||||||
${['nixos-21.11', 'nixos-22.05', 'nixos-22.05-small', 'nixos-unstable', 'nixos-unstable-small']} | ${['nixos-21.11', 'nixos-22.05', 'nixos-22.05-small', 'nixos-unstable', 'nixos-unstable-small']}
|
${['nixos-21.11', 'nixos-22.05', 'nixos-22.05-small', 'nixos-unstable', 'nixos-unstable-small']} | ${['nixos-21.11', 'nixos-22.05', 'nixos-22.05-small', 'nixos-unstable', 'nixos-unstable-small']}
|
||||||
`(
|
`(
|
||||||
|
@ -69,7 +69,7 @@ describe('modules/versioning/nixpkgs/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'nixos-22.05'} | ${'nixos-22.05'} | ${true}
|
${'nixos-22.05'} | ${'nixos-22.05'} | ${true}
|
||||||
${'nixos-22.05'} | ${'nixpkgs-22.05'} | ${false}
|
${'nixos-22.05'} | ${'nixpkgs-22.05'} | ${false}
|
||||||
|
|
|
@ -12,7 +12,7 @@ describe('modules/versioning/node/index', () => {
|
||||||
DateTime.local = dtLocal;
|
DateTime.local = dtLocal;
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'1.0.0'} | ${'replace'} | ${'1.0.0'} | ${'v1.1.0'} | ${'1.1.0'}
|
${'1.0.0'} | ${'replace'} | ${'1.0.0'} | ${'v1.1.0'} | ${'1.1.0'}
|
||||||
${'~8.0.0'} | ${'replace'} | ${'8.0.2'} | ${'v8.2.0'} | ${'~8.2.0'}
|
${'~8.0.0'} | ${'replace'} | ${'8.0.2'} | ${'v8.2.0'} | ${'~8.2.0'}
|
||||||
|
@ -37,7 +37,7 @@ describe('modules/versioning/node/index', () => {
|
||||||
const t1 = DateTime.fromISO('2020-09-01');
|
const t1 = DateTime.fromISO('2020-09-01');
|
||||||
const t2 = DateTime.fromISO('2021-06-01');
|
const t2 = DateTime.fromISO('2021-06-01');
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | time | expected
|
version | time | expected
|
||||||
${'16.0.0'} | ${t1} | ${false}
|
${'16.0.0'} | ${t1} | ${false}
|
||||||
${'15.0.0'} | ${t1} | ${false}
|
${'15.0.0'} | ${t1} | ${false}
|
||||||
|
@ -58,7 +58,7 @@ describe('modules/versioning/node/index', () => {
|
||||||
expect(nodever.isStable(version as string)).toBe(expected);
|
expect(nodever.isStable(version as string)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'16.0.0'} | ${true}
|
${'16.0.0'} | ${true}
|
||||||
${'erbium'} | ${true}
|
${'erbium'} | ${true}
|
||||||
|
@ -70,7 +70,7 @@ describe('modules/versioning/node/index', () => {
|
||||||
expect(nodever.isValid(version as string)).toBe(expected);
|
expect(nodever.isValid(version as string)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'16.0.0'} | ${'gallium'} | ${true}
|
${'16.0.0'} | ${'gallium'} | ${true}
|
||||||
${'16.0.0'} | ${'fermium'} | ${false}
|
${'16.0.0'} | ${'fermium'} | ${false}
|
||||||
|
@ -83,7 +83,7 @@ describe('modules/versioning/node/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['16.0.0']} | ${'gallium'} | ${'16.0.0'}
|
${['16.0.0']} | ${'gallium'} | ${'16.0.0'}
|
||||||
${['16.0.0', '14.0.0', '16.9.9']} | ${'gallium'} | ${'16.9.9'}
|
${['16.0.0', '14.0.0', '16.9.9']} | ${'gallium'} | ${'16.9.9'}
|
||||||
|
@ -97,7 +97,7 @@ describe('modules/versioning/node/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['16.0.0']} | ${'gallium'} | ${'16.0.0'}
|
${['16.0.0']} | ${'gallium'} | ${'16.0.0'}
|
||||||
${['16.0.0', '14.0.0', '16.9.9']} | ${'gallium'} | ${'16.0.0'}
|
${['16.0.0', '14.0.0', '16.9.9']} | ${'gallium'} | ${'16.0.0'}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { api as semver } from '.';
|
import { api as semver } from '.';
|
||||||
|
|
||||||
describe('modules/versioning/npm/index', () => {
|
describe('modules/versioning/npm/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
version | isValid
|
version | isValid
|
||||||
${'17.04.0'} | ${false}
|
${'17.04.0'} | ${false}
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
|
@ -27,7 +27,7 @@ describe('modules/versioning/npm/index', () => {
|
||||||
expect(res).toBe(isValid);
|
expect(res).toBe(isValid);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | maxSatisfying
|
versions | range | maxSatisfying
|
||||||
${['2.3.3.', '2.3.4', '2.4.5', '2.5.1', '3.0.0']} | ${'*'} | ${'3.0.0'}
|
${['2.3.3.', '2.3.4', '2.4.5', '2.5.1', '3.0.0']} | ${'*'} | ${'3.0.0'}
|
||||||
${['2.3.3.', '2.3.4', '2.4.5', '2.5.1', '3.0.0']} | ${'x'} | ${'3.0.0'}
|
${['2.3.3.', '2.3.4', '2.4.5', '2.5.1', '3.0.0']} | ${'x'} | ${'3.0.0'}
|
||||||
|
@ -43,7 +43,7 @@ describe('modules/versioning/npm/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | isSingle
|
version | isSingle
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
${'1.2.3-alpha.1'} | ${true}
|
${'1.2.3-alpha.1'} | ${true}
|
||||||
|
@ -55,7 +55,7 @@ describe('modules/versioning/npm/index', () => {
|
||||||
expect(res).toBe(isSingle);
|
expect(res).toBe(isSingle);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'1.0.0'} | ${'1.0.0'} | ${true}
|
${'1.0.0'} | ${'1.0.0'} | ${true}
|
||||||
${'1.0.0'} | ${'>=1.0.0'} | ${true}
|
${'1.0.0'} | ${'>=1.0.0'} | ${true}
|
||||||
|
@ -75,7 +75,7 @@ describe('modules/versioning/npm/index', () => {
|
||||||
expect(semver.subset!(a, b)).toBe(expected);
|
expect(semver.subset!(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'=1.0.0'} | ${'bump'} | ${'1.0.0'} | ${'1.1.0'} | ${'=1.1.0'}
|
${'=1.0.0'} | ${'bump'} | ${'1.0.0'} | ${'1.1.0'} | ${'=1.1.0'}
|
||||||
${'^1.0'} | ${'bump'} | ${'1.0.0'} | ${'1.0.7'} | ${'^1.0.7'}
|
${'^1.0'} | ${'bump'} | ${'1.0.0'} | ${'1.0.7'} | ${'^1.0.7'}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import nuget from '.';
|
import nuget from '.';
|
||||||
|
|
||||||
describe('modules/versioning/nuget/index', () => {
|
describe('modules/versioning/nuget/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${'9.0.3'} | ${true}
|
${'9.0.3'} | ${true}
|
||||||
${'1.2019.3.22'} | ${true}
|
${'1.2019.3.22'} | ${true}
|
||||||
|
@ -17,7 +17,7 @@ describe('modules/versioning/nuget/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${'9.0.3'} | ${true}
|
${'9.0.3'} | ${true}
|
||||||
${'1.2019.3.22'} | ${true}
|
${'1.2019.3.22'} | ${true}
|
||||||
|
@ -33,7 +33,7 @@ describe('modules/versioning/nuget/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${'9.0.3'} | ${true}
|
${'9.0.3'} | ${true}
|
||||||
${'1.2019.3.22'} | ${true}
|
${'1.2019.3.22'} | ${true}
|
||||||
|
@ -45,7 +45,7 @@ describe('modules/versioning/nuget/index', () => {
|
||||||
expect(nuget.isStable(input)).toBe(expected);
|
expect(nuget.isStable(input)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'17.4'} | ${'17.04'} | ${true}
|
${'17.4'} | ${'17.04'} | ${true}
|
||||||
${'1.4'} | ${'1.4.0'} | ${true}
|
${'1.4'} | ${'1.4.0'} | ${true}
|
||||||
|
@ -55,7 +55,7 @@ describe('modules/versioning/nuget/index', () => {
|
||||||
expect(nuget.equals(a, b)).toBe(expected);
|
expect(nuget.equals(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'2.4.2'} | ${'2.4.1'} | ${true}
|
${'2.4.2'} | ${'2.4.1'} | ${true}
|
||||||
${'2.4-beta'} | ${'2.4-alpha'} | ${true}
|
${'2.4-beta'} | ${'2.4-alpha'} | ${true}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import pep440 from '.';
|
import pep440 from '.';
|
||||||
|
|
||||||
describe('modules/versioning/pep440/index', () => {
|
describe('modules/versioning/pep440/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${'0.750'} | ${true}
|
${'0.750'} | ${true}
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
|
@ -20,7 +20,7 @@ describe('modules/versioning/pep440/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
${'1.2.3rc0'} | ${false}
|
${'1.2.3rc0'} | ${false}
|
||||||
|
@ -29,7 +29,7 @@ describe('modules/versioning/pep440/index', () => {
|
||||||
expect(pep440.isStable(input)).toBe(expected);
|
expect(pep440.isStable(input)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'1.0'} | ${'1.0.0'} | ${true}
|
${'1.0'} | ${'1.0.0'} | ${true}
|
||||||
${'1.0.0'} | ${'1.0..foo'} | ${false}
|
${'1.0.0'} | ${'1.0..foo'} | ${false}
|
||||||
|
@ -37,7 +37,7 @@ describe('modules/versioning/pep440/index', () => {
|
||||||
expect(pep440.equals(a, b)).toBe(expected);
|
expect(pep440.equals(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | isSingle
|
version | isSingle
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
${'1.2.3rc0'} | ${true}
|
${'1.2.3rc0'} | ${true}
|
||||||
|
@ -61,7 +61,7 @@ describe('modules/versioning/pep440/index', () => {
|
||||||
'2.0.3',
|
'2.0.3',
|
||||||
];
|
];
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
range | expected
|
range | expected
|
||||||
${'~=1.2.1'} | ${'1.2.3'}
|
${'~=1.2.1'} | ${'1.2.3'}
|
||||||
${'~=2.1'} | ${null}
|
${'~=2.1'} | ${null}
|
||||||
|
@ -72,7 +72,7 @@ describe('modules/versioning/pep440/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
range | expected
|
range | expected
|
||||||
${'~=1.2.1'} | ${'1.2.1'}
|
${'~=1.2.1'} | ${'1.2.1'}
|
||||||
${'~=2.1'} | ${null}
|
${'~=2.1'} | ${null}
|
||||||
|
@ -83,7 +83,7 @@ describe('modules/versioning/pep440/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'1.0.0'} | ${'bump'} | ${'1.0.0'} | ${'1.2.3'} | ${'1.2.3'}
|
${'1.0.0'} | ${'bump'} | ${'1.0.0'} | ${'1.2.3'} | ${'1.2.3'}
|
||||||
${'1.0.0'} | ${'replace'} | ${'1.0.0'} | ${'1.2.3'} | ${'1.2.3'}
|
${'1.0.0'} | ${'replace'} | ${'1.0.0'} | ${'1.2.3'} | ${'1.2.3'}
|
||||||
|
@ -192,7 +192,7 @@ describe('modules/versioning/pep440/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'1.0.0'} | ${'bump'} | ${'1.0.0'} | ${'1.2.3'} | ${'1.2.3'}
|
${'1.0.0'} | ${'bump'} | ${'1.0.0'} | ${'1.2.3'} | ${'1.2.3'}
|
||||||
${'1.0.0'} | ${'replace'} | ${'1.0.0'} | ${'1.2.3'} | ${'1.2.3'}
|
${'1.0.0'} | ${'replace'} | ${'1.0.0'} | ${'1.2.3'} | ${'1.2.3'}
|
||||||
|
@ -309,7 +309,7 @@ describe('modules/versioning/pep440/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'0.9.9.9'} | ${'>= 1.0.0, < 2.0.0'} | ${true}
|
${'0.9.9.9'} | ${'>= 1.0.0, < 2.0.0'} | ${true}
|
||||||
${'1.0.0a0'} | ${'>= 1.0.0, < 2.0.0'} | ${true}
|
${'1.0.0a0'} | ${'>= 1.0.0, < 2.0.0'} | ${true}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { checkRangeAndRemoveUnnecessaryRangeLimit } from './range';
|
import { checkRangeAndRemoveUnnecessaryRangeLimit } from './range';
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
rangeInput | newVersion | expected
|
rangeInput | newVersion | expected
|
||||||
${'==4.1.*,>=3.2.2'} | ${'4.1.1'} | ${'==4.1.*'}
|
${'==4.1.*,>=3.2.2'} | ${'4.1.1'} | ${'==4.1.*'}
|
||||||
${'==4.0.*,>=3.2.2'} | ${'4.0.0'} | ${'==4.0.*'}
|
${'==4.0.*,>=3.2.2'} | ${'4.0.0'} | ${'==4.0.*'}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import perl from '.';
|
import perl from '.';
|
||||||
|
|
||||||
describe('modules/versioning/perl/index', () => {
|
describe('modules/versioning/perl/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${'1'} | ${true}
|
${'1'} | ${true}
|
||||||
${'1.2'} | ${true}
|
${'1.2'} | ${true}
|
||||||
|
@ -28,7 +28,7 @@ describe('modules/versioning/perl/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${'1'} | ${true}
|
${'1'} | ${true}
|
||||||
${'1.234'} | ${true}
|
${'1.234'} | ${true}
|
||||||
|
@ -41,7 +41,7 @@ describe('modules/versioning/perl/index', () => {
|
||||||
expect(perl.isStable(input)).toBe(expected);
|
expect(perl.isStable(input)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'1.2'} | ${'v1.200.0'} | ${true}
|
${'1.2'} | ${'v1.200.0'} | ${true}
|
||||||
${'1.02'} | ${'v1.20.0'} | ${true}
|
${'1.02'} | ${'v1.20.0'} | ${true}
|
||||||
|
@ -55,7 +55,7 @@ describe('modules/versioning/perl/index', () => {
|
||||||
expect(perl.equals(a, b)).toBe(expected);
|
expect(perl.equals(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'2.4.2'} | ${'2.4.1'} | ${true}
|
${'2.4.2'} | ${'2.4.1'} | ${true}
|
||||||
${'0.1301'} | ${'0.13_01'} | ${true}
|
${'0.1301'} | ${'0.13_01'} | ${true}
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { api as versioning } from '.';
|
||||||
|
|
||||||
describe('modules/versioning/poetry/index', () => {
|
describe('modules/versioning/poetry/index', () => {
|
||||||
describe('equals', () => {
|
describe('equals', () => {
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'1'} | ${'1'} | ${true}
|
${'1'} | ${'1'} | ${true}
|
||||||
${'1.0'} | ${'1'} | ${true}
|
${'1.0'} | ${'1'} | ${true}
|
||||||
|
@ -21,7 +21,7 @@ describe('modules/versioning/poetry/index', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | major | minor | patch
|
version | major | minor | patch
|
||||||
${'1'} | ${1} | ${0} | ${0}
|
${'1'} | ${1} | ${0} | ${0}
|
||||||
${'1.9'} | ${1} | ${9} | ${0}
|
${'1.9'} | ${1} | ${9} | ${0}
|
||||||
|
@ -40,7 +40,7 @@ describe('modules/versioning/poetry/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'2'} | ${'1'} | ${true}
|
${'2'} | ${'1'} | ${true}
|
||||||
${'2.0'} | ${'1'} | ${true}
|
${'2.0'} | ${'1'} | ${true}
|
||||||
|
@ -56,7 +56,7 @@ describe('modules/versioning/poetry/index', () => {
|
||||||
expect(versioning.isGreaterThan(a, b)).toBe(expected);
|
expect(versioning.isGreaterThan(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1'} | ${true}
|
${'1'} | ${true}
|
||||||
${'1.9'} | ${true}
|
${'1.9'} | ${true}
|
||||||
|
@ -69,7 +69,7 @@ describe('modules/versioning/poetry/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.3a0'} | ${true}
|
${'1.2.3a0'} | ${true}
|
||||||
${'1.2.3b1'} | ${true}
|
${'1.2.3b1'} | ${true}
|
||||||
|
@ -81,7 +81,7 @@ describe('modules/versioning/poetry/index', () => {
|
||||||
expect(!!versioning.isVersion(version)).toBe(expected);
|
expect(!!versioning.isVersion(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'17.04.00'} | ${true}
|
${'17.04.00'} | ${true}
|
||||||
${'17.b4.0'} | ${false}
|
${'17.b4.0'} | ${false}
|
||||||
|
@ -105,7 +105,7 @@ describe('modules/versioning/poetry/index', () => {
|
||||||
expect(!!versioning.isValid(version)).toBe(expected);
|
expect(!!versioning.isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
${'1.2.3-alpha.1'} | ${true}
|
${'1.2.3-alpha.1'} | ${true}
|
||||||
|
@ -116,7 +116,7 @@ describe('modules/versioning/poetry/index', () => {
|
||||||
expect(!!versioning.isSingleVersion(version)).toBe(expected);
|
expect(!!versioning.isSingleVersion(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'4.2.0'} | ${'4.2, >= 3.0, < 5.0.0'} | ${true}
|
${'4.2.0'} | ${'4.2, >= 3.0, < 5.0.0'} | ${true}
|
||||||
${'4.2.0'} | ${'2.0, >= 3.0, < 5.0.0'} | ${false}
|
${'4.2.0'} | ${'2.0, >= 3.0, < 5.0.0'} | ${false}
|
||||||
|
@ -138,7 +138,7 @@ describe('modules/versioning/poetry/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'0.9.0'} | ${'>= 1.0.0 <= 2.0.0'} | ${true}
|
${'0.9.0'} | ${'>= 1.0.0 <= 2.0.0'} | ${true}
|
||||||
${'1.9.0'} | ${'>= 1.0.0 <= 2.0.0'} | ${false}
|
${'1.9.0'} | ${'>= 1.0.0 <= 2.0.0'} | ${false}
|
||||||
|
@ -149,7 +149,7 @@ describe('modules/versioning/poetry/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['0.4.0', '0.5.0', '4.2.0', '4.3.0', '5.0.0']} | ${'4.*, > 4.2'} | ${'4.3.0'}
|
${['0.4.0', '0.5.0', '4.2.0', '4.3.0', '5.0.0']} | ${'4.*, > 4.2'} | ${'4.3.0'}
|
||||||
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'^4.0.0'} | ${'4.2.0'}
|
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'^4.0.0'} | ${'4.2.0'}
|
||||||
|
@ -165,7 +165,7 @@ describe('modules/versioning/poetry/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['4.2.1', '0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'4.*.0, < 4.2.5'} | ${'4.2.1'}
|
${['4.2.1', '0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'4.*.0, < 4.2.5'} | ${'4.2.1'}
|
||||||
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0', '5.0.3']} | ${'5.0, > 5.0.0'} | ${'5.0.3'}
|
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0', '5.0.3']} | ${'5.0, > 5.0.0'} | ${'5.0.3'}
|
||||||
|
@ -178,7 +178,7 @@ describe('modules/versioning/poetry/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'1.0.0'} | ${'bump'} | ${'1.0.0'} | ${'1.1.0'} | ${'1.1.0'}
|
${'1.0.0'} | ${'bump'} | ${'1.0.0'} | ${'1.1.0'} | ${'1.1.0'}
|
||||||
${' 1.0.0'} | ${'bump'} | ${'1.0.0'} | ${'1.1.0'} | ${'1.1.0'}
|
${' 1.0.0'} | ${'bump'} | ${'1.0.0'} | ${'1.1.0'} | ${'1.1.0'}
|
||||||
|
@ -241,7 +241,7 @@ describe('modules/versioning/poetry/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'2'} | ${'1'} | ${1}
|
${'2'} | ${'1'} | ${1}
|
||||||
${'2.0'} | ${'1'} | ${1}
|
${'2.0'} | ${'1'} | ${1}
|
||||||
|
@ -259,7 +259,7 @@ describe('modules/versioning/poetry/index', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'1.0.0'} | ${'1.0.0'} | ${true}
|
${'1.0.0'} | ${'1.0.0'} | ${true}
|
||||||
${'1.0.0'} | ${'>=1.0.0'} | ${true}
|
${'1.0.0'} | ${'>=1.0.0'} | ${true}
|
||||||
|
|
|
@ -3,7 +3,7 @@ import type { NewValueConfig } from '../types';
|
||||||
import { api as versioning } from '.';
|
import { api as versioning } from '.';
|
||||||
|
|
||||||
describe('modules/versioning/python/index', () => {
|
describe('modules/versioning/python/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'17.04.00'} | ${true}
|
${'17.04.00'} | ${true}
|
||||||
${'17.b4.0'} | ${false}
|
${'17.b4.0'} | ${false}
|
||||||
|
@ -27,7 +27,7 @@ describe('modules/versioning/python/index', () => {
|
||||||
expect(!!versioning.isValid(version)).toBe(expected);
|
expect(!!versioning.isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'4.2.0'} | ${'4.2, >= 3.0, < 5.0.0'} | ${true}
|
${'4.2.0'} | ${'4.2, >= 3.0, < 5.0.0'} | ${true}
|
||||||
${'4.2.0'} | ${'2.0, >= 3.0, < 5.0.0'} | ${false}
|
${'4.2.0'} | ${'2.0, >= 3.0, < 5.0.0'} | ${false}
|
||||||
|
@ -53,7 +53,7 @@ describe('modules/versioning/python/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'0.9.0'} | ${'>= 1.0.0 <= 2.0.0'} | ${true}
|
${'0.9.0'} | ${'>= 1.0.0 <= 2.0.0'} | ${true}
|
||||||
${'1.9.0'} | ${'>= 1.0.0 <= 2.0.0'} | ${false}
|
${'1.9.0'} | ${'>= 1.0.0 <= 2.0.0'} | ${false}
|
||||||
|
@ -65,7 +65,7 @@ describe('modules/versioning/python/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['0.4.0', '0.5.0', '4.2.0', '4.3.0', '5.0.0']} | ${'4.*, > 4.2'} | ${'4.3.0'}
|
${['0.4.0', '0.5.0', '4.2.0', '4.3.0', '5.0.0']} | ${'4.*, > 4.2'} | ${'4.3.0'}
|
||||||
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'^4.0.0'} | ${'4.2.0'}
|
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'^4.0.0'} | ${'4.2.0'}
|
||||||
|
@ -82,7 +82,7 @@ describe('modules/versioning/python/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['4.2.1', '0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'4.*.0, < 4.2.5'} | ${'4.2.1'}
|
${['4.2.1', '0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0']} | ${'4.*.0, < 4.2.5'} | ${'4.2.1'}
|
||||||
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0', '5.0.3']} | ${'5.0, > 5.0.0'} | ${'5.0.3'}
|
${['0.4.0', '0.5.0', '4.0.0', '4.2.0', '5.0.0', '5.0.3']} | ${'5.0, > 5.0.0'} | ${'5.0.3'}
|
||||||
|
@ -101,7 +101,7 @@ describe('modules/versioning/python/index', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'1.0.0'} | ${'1.0.0'} | ${true}
|
${'1.0.0'} | ${'1.0.0'} | ${true}
|
||||||
${'1.0.0'} | ${'>=1.0.0'} | ${true}
|
${'1.0.0'} | ${'>=1.0.0'} | ${true}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import redhat from '.';
|
import redhat from '.';
|
||||||
|
|
||||||
describe('modules/versioning/redhat/index', () => {
|
describe('modules/versioning/redhat/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${'1'} | ${true}
|
${'1'} | ${true}
|
||||||
${'17.04'} | ${true}
|
${'17.04'} | ${true}
|
||||||
|
@ -25,7 +25,7 @@ describe('modules/versioning/redhat/index', () => {
|
||||||
expect(redhat.isValid(input)).toBe(expected);
|
expect(redhat.isValid(input)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'3-57'} | ${'3-2'} | ${true}
|
${'3-57'} | ${'3-2'} | ${true}
|
||||||
${'8.6'} | ${'8.4'} | ${true}
|
${'8.6'} | ${'8.4'} | ${true}
|
||||||
|
|
|
@ -33,7 +33,7 @@ describe('modules/versioning/regex/index', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1'} | ${false}
|
${'1'} | ${false}
|
||||||
${'aardvark'} | ${false}
|
${'aardvark'} | ${false}
|
||||||
|
@ -56,7 +56,7 @@ describe('modules/versioning/regex/index', () => {
|
||||||
expect(regex.isValid(version)).toBe(expected);
|
expect(regex.isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'1.2.3'} | ${'2.3.4'} | ${true}
|
${'1.2.3'} | ${'2.3.4'} | ${true}
|
||||||
${'1.2.3a1'} | ${'2.3.4'} | ${true}
|
${'1.2.3a1'} | ${'2.3.4'} | ${true}
|
||||||
|
@ -81,7 +81,7 @@ describe('modules/versioning/regex/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
${'1.2.3a1'} | ${true}
|
${'1.2.3a1'} | ${true}
|
||||||
|
@ -102,7 +102,7 @@ describe('modules/versioning/regex/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
${'1.2.3-foo'} | ${true}
|
${'1.2.3-foo'} | ${true}
|
||||||
|
@ -113,7 +113,7 @@ describe('modules/versioning/regex/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
${'1.2.3a1'} | ${true}
|
${'1.2.3a1'} | ${true}
|
||||||
|
@ -133,7 +133,7 @@ describe('modules/versioning/regex/index', () => {
|
||||||
expect(!!regex.isVersion(version)).toBe(expected);
|
expect(!!regex.isVersion(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | major | minor | patch
|
version | major | minor | patch
|
||||||
${'1.2.3'} | ${1} | ${2} | ${3}
|
${'1.2.3'} | ${1} | ${2} | ${3}
|
||||||
${'1.2.3a1'} | ${1} | ${2} | ${3}
|
${'1.2.3a1'} | ${1} | ${2} | ${3}
|
||||||
|
@ -147,7 +147,7 @@ describe('modules/versioning/regex/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'1.2.3'} | ${'1.2.3'} | ${true}
|
${'1.2.3'} | ${'1.2.3'} | ${true}
|
||||||
${'1.2.3a1'} | ${'1.2.3a1'} | ${true}
|
${'1.2.3a1'} | ${'1.2.3a1'} | ${true}
|
||||||
|
@ -169,7 +169,7 @@ describe('modules/versioning/regex/index', () => {
|
||||||
expect(regex.equals(a, b)).toBe(expected);
|
expect(regex.equals(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'2.0.0'} | ${'1.0.0'} | ${true}
|
${'2.0.0'} | ${'1.0.0'} | ${true}
|
||||||
${'2.2.0'} | ${'2.1.0'} | ${true}
|
${'2.2.0'} | ${'2.1.0'} | ${true}
|
||||||
|
@ -202,7 +202,7 @@ describe('modules/versioning/regex/index', () => {
|
||||||
expect(regex.isGreaterThan(a, b)).toBe(expected);
|
expect(regex.isGreaterThan(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'1.2.2'} | ${'1.2.3'} | ${true}
|
${'1.2.2'} | ${'1.2.3'} | ${true}
|
||||||
${'1.2.2'} | ${'1.2.3-bar'} | ${true}
|
${'1.2.2'} | ${'1.2.3-bar'} | ${true}
|
||||||
|
@ -251,7 +251,7 @@ describe('modules/versioning/regex/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['2.1.5', '2.1.6a1', '2.1.6', '2.1.6-foo']} | ${'2.1.6'} | ${'2.1.6'}
|
${['2.1.5', '2.1.6a1', '2.1.6', '2.1.6-foo']} | ${'2.1.6'} | ${'2.1.6'}
|
||||||
${['2.1.5', '2.1.6a1', '2.1.6', '2.1.6-foo']} | ${'2.1.6-foo'} | ${'2.1.6'}
|
${['2.1.5', '2.1.6a1', '2.1.6', '2.1.6-foo']} | ${'2.1.6-foo'} | ${'2.1.6'}
|
||||||
|
@ -265,7 +265,7 @@ describe('modules/versioning/regex/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['2.1.5', '2.1.6a1', '2.1.6', '2.1.6-foo']} | ${'2.1.6'} | ${'2.1.6'}
|
${['2.1.5', '2.1.6a1', '2.1.6', '2.1.6-foo']} | ${'2.1.6'} | ${'2.1.6'}
|
||||||
${['2.1.5', '2.1.6a1', '2.1.6', '2.1.6-foo']} | ${'2.1.6-foo'} | ${'2.1.6'}
|
${['2.1.5', '2.1.6a1', '2.1.6', '2.1.6-foo']} | ${'2.1.6-foo'} | ${'2.1.6'}
|
||||||
|
@ -302,7 +302,7 @@ describe('modules/versioning/regex/index', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'1.2.2'} | ${'1.2.2'} | ${true}
|
${'1.2.2'} | ${'1.2.2'} | ${true}
|
||||||
${'1.2.2'} | ${'1.2.2-bar'} | ${true}
|
${'1.2.2'} | ${'1.2.2-bar'} | ${true}
|
||||||
|
@ -357,7 +357,7 @@ describe('modules/versioning/regex/index', () => {
|
||||||
'regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)(:?-(?<compatibility>.+)(?<build>\\d+)-r(?<revision>\\d+))?$'
|
'regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)(:?-(?<compatibility>.+)(?<build>\\d+)-r(?<revision>\\d+))?$'
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'12.7.0-debian-10-r69'} | ${true}
|
${'12.7.0-debian-10-r69'} | ${true}
|
||||||
${'12.7.0-debian-10-r100'} | ${true}
|
${'12.7.0-debian-10-r100'} | ${true}
|
||||||
|
@ -365,7 +365,7 @@ describe('modules/versioning/regex/index', () => {
|
||||||
expect(!!re.isValid(version)).toBe(expected);
|
expect(!!re.isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'12.7.0-debian-10-r69'} | ${'12.7.0-debian-10-r100'} | ${true}
|
${'12.7.0-debian-10-r69'} | ${'12.7.0-debian-10-r100'} | ${true}
|
||||||
`(
|
`(
|
||||||
|
@ -376,7 +376,7 @@ describe('modules/versioning/regex/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'12.7.0-debian-10-r69'} | ${'12.7.0-debian-10-r100'} | ${false}
|
${'12.7.0-debian-10-r69'} | ${'12.7.0-debian-10-r100'} | ${false}
|
||||||
${'12.7.0-debian-10-r169'} | ${'12.7.0-debian-10-r100'} | ${true}
|
${'12.7.0-debian-10-r169'} | ${'12.7.0-debian-10-r100'} | ${true}
|
||||||
|
@ -384,7 +384,7 @@ describe('modules/versioning/regex/index', () => {
|
||||||
expect(re.isGreaterThan(a, b)).toBe(expected);
|
expect(re.isGreaterThan(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'12.7.0-debian-9-r69'} | ${'12.7.0-debian-10-r69'} | ${true}
|
${'12.7.0-debian-9-r69'} | ${'12.7.0-debian-10-r69'} | ${true}
|
||||||
${'12.7.0-debian-9-r69'} | ${'12.7.0-debian-10-r68'} | ${true}
|
${'12.7.0-debian-9-r69'} | ${'12.7.0-debian-10-r68'} | ${true}
|
||||||
|
|
|
@ -2,7 +2,7 @@ import semver from '../semver';
|
||||||
import { api as versioning } from '.';
|
import { api as versioning } from '.';
|
||||||
|
|
||||||
describe('modules/versioning/rez/index', () => {
|
describe('modules/versioning/rez/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
version | equal | expected
|
version | equal | expected
|
||||||
${'1'} | ${'1'} | ${true}
|
${'1'} | ${'1'} | ${true}
|
||||||
${'1.0'} | ${'1'} | ${true}
|
${'1.0'} | ${'1'} | ${true}
|
||||||
|
@ -18,7 +18,7 @@ describe('modules/versioning/rez/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1'} | ${1}
|
${'1'} | ${1}
|
||||||
${'1.9'} | ${1}
|
${'1.9'} | ${1}
|
||||||
|
@ -27,7 +27,7 @@ describe('modules/versioning/rez/index', () => {
|
||||||
expect(versioning.getMajor(version)).toEqual(expected);
|
expect(versioning.getMajor(version)).toEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1'} | ${0}
|
${'1'} | ${0}
|
||||||
${'1.9'} | ${9}
|
${'1.9'} | ${9}
|
||||||
|
@ -36,7 +36,7 @@ describe('modules/versioning/rez/index', () => {
|
||||||
expect(versioning.getMinor(version)).toEqual(expected);
|
expect(versioning.getMinor(version)).toEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1'} | ${0}
|
${'1'} | ${0}
|
||||||
${'1.9'} | ${0}
|
${'1.9'} | ${0}
|
||||||
|
@ -46,7 +46,7 @@ describe('modules/versioning/rez/index', () => {
|
||||||
expect(versioning.getPatch(version)).toEqual(expected);
|
expect(versioning.getPatch(version)).toEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | other | expected
|
version | other | expected
|
||||||
${'2'} | ${'1'} | ${true}
|
${'2'} | ${'1'} | ${true}
|
||||||
${'2.0'} | ${'1'} | ${true}
|
${'2.0'} | ${'1'} | ${true}
|
||||||
|
@ -64,7 +64,7 @@ describe('modules/versioning/rez/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1'} | ${true}
|
${'1'} | ${true}
|
||||||
${'1.9'} | ${true}
|
${'1.9'} | ${true}
|
||||||
|
@ -75,7 +75,7 @@ describe('modules/versioning/rez/index', () => {
|
||||||
expect(versioning.isStable(version)).toEqual(expected);
|
expect(versioning.isStable(version)).toEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${'1.2.3..1.2.4'} | ${true}
|
${'1.2.3..1.2.4'} | ${true}
|
||||||
${'1.2..1.3'} | ${true}
|
${'1.2..1.3'} | ${true}
|
||||||
|
@ -97,7 +97,7 @@ describe('modules/versioning/rez/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
`('isVersion("$input") === $expected', ({ input, expected }) => {
|
`('isVersion("$input") === $expected', ({ input, expected }) => {
|
||||||
|
@ -105,7 +105,7 @@ describe('modules/versioning/rez/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
${'1.2.3-alpha.1'} | ${true}
|
${'1.2.3-alpha.1'} | ${true}
|
||||||
|
@ -116,7 +116,7 @@ describe('modules/versioning/rez/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['1.2.3', '1.2.4', '1.2.5']} | ${'1.2.3..1.2.4'} | ${'1.2.3'}
|
${['1.2.3', '1.2.4', '1.2.5']} | ${'1.2.3..1.2.4'} | ${'1.2.3'}
|
||||||
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'4'} | ${'4.2.0'}
|
${['0.4.0', '0.5.0', '4.2.0', '5.0.0']} | ${'4'} | ${'4.2.0'}
|
||||||
|
@ -132,7 +132,7 @@ describe('modules/versioning/rez/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['1.2.3', '1.2.4', '1.2.5']} | ${'1.2.3..1.2.4'} | ${'1.2.3'}
|
${['1.2.3', '1.2.4', '1.2.5']} | ${'1.2.3..1.2.4'} | ${'1.2.3'}
|
||||||
`(
|
`(
|
||||||
|
@ -142,7 +142,7 @@ describe('modules/versioning/rez/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'1.2.3'} | ${'1.2.3..1.2.4'} | ${false}
|
${'1.2.3'} | ${'1.2.3..1.2.4'} | ${false}
|
||||||
${'1.2.3'} | ${'1.2.4..1.2.5'} | ${true}
|
${'1.2.3'} | ${'1.2.4..1.2.5'} | ${true}
|
||||||
|
@ -155,7 +155,7 @@ describe('modules/versioning/rez/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'1.2.3'} | ${'1.2.3..1.2.4'} | ${true}
|
${'1.2.3'} | ${'1.2.3..1.2.4'} | ${true}
|
||||||
${'1.2.4'} | ${'1.2.2..1.2.3'} | ${false}
|
${'1.2.4'} | ${'1.2.2..1.2.3'} | ${false}
|
||||||
|
@ -175,7 +175,7 @@ describe('modules/versioning/rez/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b
|
a | b
|
||||||
${'1.1.1'} | ${'1.2.3'}
|
${'1.1.1'} | ${'1.2.3'}
|
||||||
${'1.2.3'} | ${'1.3.4'}
|
${'1.2.3'} | ${'1.3.4'}
|
||||||
|
@ -190,7 +190,7 @@ describe('modules/versioning/rez/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'==1.2.3'} | ${'replace'} | ${'1.2.3'} | ${'1.2.4'} | ${'==1.2.4'}
|
${'==1.2.3'} | ${'replace'} | ${'1.2.3'} | ${'1.2.4'} | ${'==1.2.4'}
|
||||||
${'1.2.3'} | ${'auto'} | ${'1.2.3'} | ${'1.2.4'} | ${'1.2.4'}
|
${'1.2.3'} | ${'auto'} | ${'1.2.3'} | ${'1.2.4'} | ${'1.2.4'}
|
||||||
|
@ -440,7 +440,7 @@ describe('modules/versioning/rez/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.0'} | ${true}
|
${'1.2.0'} | ${true}
|
||||||
`('isCompatible("$version") === $expected', ({ version, expected }) => {
|
`('isCompatible("$version") === $expected', ({ version, expected }) => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { api as semverRuby } from '.';
|
import { api as semverRuby } from '.';
|
||||||
|
|
||||||
describe('modules/versioning/ruby/index', () => {
|
describe('modules/versioning/ruby/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'1.0.0'} | ${'1'} | ${true}
|
${'1.0.0'} | ${'1'} | ${true}
|
||||||
${'1.2.0'} | ${'1.2'} | ${true}
|
${'1.2.0'} | ${'1.2'} | ${true}
|
||||||
|
@ -15,7 +15,7 @@ describe('modules/versioning/ruby/index', () => {
|
||||||
expect(semverRuby.equals(a, b)).toBe(expected);
|
expect(semverRuby.equals(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | major | minor | patch
|
version | major | minor | patch
|
||||||
${'1'} | ${1} | ${null} | ${null}
|
${'1'} | ${1} | ${null} | ${null}
|
||||||
${'1.2'} | ${1} | ${2} | ${null}
|
${'1.2'} | ${1} | ${2} | ${null}
|
||||||
|
@ -30,7 +30,7 @@ describe('modules/versioning/ruby/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'0'} | ${true}
|
${'0'} | ${true}
|
||||||
${'v0'} | ${true}
|
${'v0'} | ${true}
|
||||||
|
@ -53,7 +53,7 @@ describe('modules/versioning/ruby/index', () => {
|
||||||
expect(!!semverRuby.isVersion(version)).toBe(expected);
|
expect(!!semverRuby.isVersion(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'2'} | ${'1'} | ${true}
|
${'2'} | ${'1'} | ${true}
|
||||||
${'2.2'} | ${'2.1'} | ${true}
|
${'2.2'} | ${'2.1'} | ${true}
|
||||||
|
@ -92,7 +92,7 @@ describe('modules/versioning/ruby/index', () => {
|
||||||
expect(semverRuby.isGreaterThan(a, b)).toBe(expected);
|
expect(semverRuby.isGreaterThan(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1'} | ${true}
|
${'1'} | ${true}
|
||||||
${'1.2'} | ${true}
|
${'1.2'} | ${true}
|
||||||
|
@ -110,14 +110,14 @@ describe('modules/versioning/ruby/index', () => {
|
||||||
expect(res).toBe(expected);
|
expect(res).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | expected
|
versions | expected
|
||||||
${['1.2.3-beta', '2.0.1', '1.3.4', '1.2.3']} | ${['1.2.3-beta', '1.2.3', '1.3.4', '2.0.1']}
|
${['1.2.3-beta', '2.0.1', '1.3.4', '1.2.3']} | ${['1.2.3-beta', '1.2.3', '1.3.4', '2.0.1']}
|
||||||
`('$versions -> sortVersions -> $expected ', ({ versions, expected }) => {
|
`('$versions -> sortVersions -> $expected ', ({ versions, expected }) => {
|
||||||
expect(versions.sort(semverRuby.sortVersions)).toEqual(expected);
|
expect(versions.sort(semverRuby.sortVersions)).toEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['2.1.5', '2.1.6']} | ${'~> 2.1'} | ${'2.1.5'}
|
${['2.1.5', '2.1.6']} | ${'~> 2.1'} | ${'2.1.5'}
|
||||||
${['2.1.6', '2.1.5']} | ${'~> 2.1.6'} | ${'2.1.6'}
|
${['2.1.6', '2.1.5']} | ${'~> 2.1.6'} | ${'2.1.6'}
|
||||||
|
@ -132,7 +132,7 @@ describe('modules/versioning/ruby/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['2.1.5', '2.1.6']} | ${'~> 2.1'} | ${'2.1.6'}
|
${['2.1.5', '2.1.6']} | ${'~> 2.1'} | ${'2.1.6'}
|
||||||
${['2.1.6', '2.1.5']} | ${'~> 2.1.6'} | ${'2.1.6'}
|
${['2.1.6', '2.1.5']} | ${'~> 2.1.6'} | ${'2.1.6'}
|
||||||
|
@ -147,7 +147,7 @@ describe('modules/versioning/ruby/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'1.2'} | ${'>= 1.2'} | ${true}
|
${'1.2'} | ${'>= 1.2'} | ${true}
|
||||||
${'1.2.3'} | ${'~> 1.2.1'} | ${true}
|
${'1.2.3'} | ${'~> 1.2.1'} | ${true}
|
||||||
|
@ -164,7 +164,7 @@ describe('modules/versioning/ruby/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'1.2.2'} | ${'< 1.2.2'} | ${true}
|
${'1.2.2'} | ${'< 1.2.2'} | ${true}
|
||||||
${'1.1.4'} | ${'>= 1.1.5, < 2.0'} | ${true}
|
${'1.1.4'} | ${'>= 1.1.5, < 2.0'} | ${true}
|
||||||
|
@ -183,7 +183,7 @@ describe('modules/versioning/ruby/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1'} | ${true}
|
${'1'} | ${true}
|
||||||
${'1.2'} | ${true}
|
${'1.2'} | ${true}
|
||||||
|
@ -197,7 +197,7 @@ describe('modules/versioning/ruby/index', () => {
|
||||||
expect(!!semverRuby.isValid(version)).toBe(expected);
|
expect(!!semverRuby.isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1'} | ${true}
|
${'1'} | ${true}
|
||||||
${'1.1'} | ${true}
|
${'1.1'} | ${true}
|
||||||
|
@ -221,7 +221,7 @@ describe('modules/versioning/ruby/index', () => {
|
||||||
expect(!!semverRuby.isValid(version)).toBe(expected);
|
expect(!!semverRuby.isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1'} | ${true}
|
${'1'} | ${true}
|
||||||
${'1.2'} | ${true}
|
${'1.2'} | ${true}
|
||||||
|
@ -250,7 +250,7 @@ describe('modules/versioning/ruby/index', () => {
|
||||||
expect(!!semverRuby.isSingleVersion(version)).toBe(expected);
|
expect(!!semverRuby.isSingleVersion(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'1.0.3'} | ${'pin'} | ${'1.0.3'} | ${'1.2.3'} | ${'1.2.3'}
|
${'1.0.3'} | ${'pin'} | ${'1.0.3'} | ${'1.2.3'} | ${'1.2.3'}
|
||||||
${'v1.0.3'} | ${'pin'} | ${'1.0.3'} | ${'1.2.3'} | ${'v1.2.3'}
|
${'v1.0.3'} | ${'pin'} | ${'1.0.3'} | ${'1.2.3'} | ${'v1.2.3'}
|
||||||
|
|
|
@ -49,7 +49,7 @@ describe('modules/versioning/semver-coerced/index', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('.getPatch(input)', () => {
|
describe('.getPatch(input)', () => {
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.0.2'} | ${2}
|
${'1.0.2'} | ${2}
|
||||||
${'v3.1.2-foo'} | ${2}
|
${'v3.1.2-foo'} | ${2}
|
||||||
|
@ -131,7 +131,7 @@ describe('modules/versioning/semver-coerced/index', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('.isStable(input)', () => {
|
describe('.isStable(input)', () => {
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.0.0'} | ${true}
|
${'1.0.0'} | ${true}
|
||||||
${'v1.3.5'} | ${true}
|
${'v1.3.5'} | ${true}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { isSemVerXRange } from './common';
|
import { isSemVerXRange } from './common';
|
||||||
|
|
||||||
describe('modules/versioning/semver/common', () => {
|
describe('modules/versioning/semver/common', () => {
|
||||||
test.each`
|
it.each`
|
||||||
range | expected
|
range | expected
|
||||||
${'*'} | ${true}
|
${'*'} | ${true}
|
||||||
${'x'} | ${true}
|
${'x'} | ${true}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import semver from '.';
|
import semver from '.';
|
||||||
|
|
||||||
describe('modules/versioning/semver/index', () => {
|
describe('modules/versioning/semver/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'17.04.0'} | ${false}
|
${'17.04.0'} | ${false}
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
|
@ -17,7 +17,7 @@ describe('modules/versioning/semver/index', () => {
|
||||||
expect(!!semver.isValid(version)).toBe(expected);
|
expect(!!semver.isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
${'1.2.3-alpha.1'} | ${true}
|
${'1.2.3-alpha.1'} | ${true}
|
||||||
|
@ -28,7 +28,7 @@ describe('modules/versioning/semver/index', () => {
|
||||||
expect(!!semver.isSingleVersion(version)).toBe(expected);
|
expect(!!semver.isSingleVersion(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'=1.0.0'} | ${'bump'} | ${'1.0.0'} | ${'1.1.0'} | ${'1.1.0'}
|
${'=1.0.0'} | ${'bump'} | ${'1.0.0'} | ${'1.1.0'} | ${'1.1.0'}
|
||||||
`(
|
`(
|
||||||
|
@ -44,7 +44,7 @@ describe('modules/versioning/semver/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'1.2.0'} | ${true}
|
${'1.2.0'} | ${true}
|
||||||
`('isCompatible("$version") === $expected', ({ version, expected }) => {
|
`('isCompatible("$version") === $expected', ({ version, expected }) => {
|
||||||
|
|
|
@ -11,7 +11,7 @@ const {
|
||||||
} = swift;
|
} = swift;
|
||||||
|
|
||||||
describe('modules/versioning/swift/index', () => {
|
describe('modules/versioning/swift/index', () => {
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'from: "1.2.3"'} | ${false}
|
${'from: "1.2.3"'} | ${false}
|
||||||
${'1.2.3'} | ${true}
|
${'1.2.3'} | ${true}
|
||||||
|
@ -19,7 +19,7 @@ describe('modules/versioning/swift/index', () => {
|
||||||
expect(!!isVersion(version)).toBe(expected);
|
expect(!!isVersion(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${'from: "1.2.3"'} | ${true}
|
${'from: "1.2.3"'} | ${true}
|
||||||
${'from : "1.2.3"'} | ${true}
|
${'from : "1.2.3"'} | ${true}
|
||||||
|
@ -57,7 +57,7 @@ describe('modules/versioning/swift/index', () => {
|
||||||
expect(!!isValid(version)).toBe(expected);
|
expect(!!isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['1.2.3', '1.2.4', '1.2.5']} | ${'..<"1.2.4"'} | ${'1.2.3'}
|
${['1.2.3', '1.2.4', '1.2.5']} | ${'..<"1.2.4"'} | ${'1.2.3'}
|
||||||
${['v1.2.3', 'v1.2.4', 'v1.2.5']} | ${'..<"1.2.4"'} | ${'1.2.3'}
|
${['v1.2.3', 'v1.2.4', 'v1.2.5']} | ${'..<"1.2.4"'} | ${'1.2.3'}
|
||||||
|
@ -68,7 +68,7 @@ describe('modules/versioning/swift/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['1.2.3', '1.2.4', '1.2.5']} | ${'..<"1.2.4"'} | ${'1.2.3'}
|
${['1.2.3', '1.2.4', '1.2.5']} | ${'..<"1.2.4"'} | ${'1.2.3'}
|
||||||
${['v1.2.3', 'v1.2.4', 'v1.2.5']} | ${'..<"1.2.4"'} | ${'1.2.3'}
|
${['v1.2.3', 'v1.2.4', 'v1.2.5']} | ${'..<"1.2.4"'} | ${'1.2.3'}
|
||||||
|
@ -80,7 +80,7 @@ describe('modules/versioning/swift/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'1.2.3'} | ${'..."1.2.4"'} | ${false}
|
${'1.2.3'} | ${'..."1.2.4"'} | ${false}
|
||||||
${'v1.2.3'} | ${'..."1.2.4"'} | ${false}
|
${'v1.2.3'} | ${'..."1.2.4"'} | ${false}
|
||||||
|
@ -93,7 +93,7 @@ describe('modules/versioning/swift/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'1.2.4'} | ${'..."1.2.4"'} | ${true}
|
${'1.2.4'} | ${'..."1.2.4"'} | ${true}
|
||||||
${'v1.2.4'} | ${'..."1.2.4"'} | ${true}
|
${'v1.2.4'} | ${'..."1.2.4"'} | ${true}
|
||||||
|
@ -106,7 +106,7 @@ describe('modules/versioning/swift/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${'1.2.3'} | ${'auto'} | ${'1.2.3'} | ${'1.2.4'} | ${'1.2.3'}
|
${'1.2.3'} | ${'auto'} | ${'1.2.3'} | ${'1.2.4'} | ${'1.2.3'}
|
||||||
${'v1.2.3'} | ${'auto'} | ${'v1.2.3'} | ${'v1.2.4'} | ${'v1.2.3'}
|
${'v1.2.3'} | ${'auto'} | ${'v1.2.3'} | ${'v1.2.4'} | ${'v1.2.3'}
|
||||||
|
|
|
@ -8,7 +8,7 @@ describe('modules/versioning/ubuntu/index', () => {
|
||||||
jest.resetAllMocks();
|
jest.resetAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${undefined} | ${false}
|
${undefined} | ${false}
|
||||||
${null} | ${false}
|
${null} | ${false}
|
||||||
|
@ -89,7 +89,7 @@ describe('modules/versioning/ubuntu/index', () => {
|
||||||
expect(ubuntu.isValid(version)).toBe(expected);
|
expect(ubuntu.isValid(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${undefined} | ${undefined} | ${false}
|
${undefined} | ${undefined} | ${false}
|
||||||
${null} | ${undefined} | ${false}
|
${null} | ${undefined} | ${false}
|
||||||
|
@ -105,7 +105,7 @@ describe('modules/versioning/ubuntu/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${undefined} | ${false}
|
${undefined} | ${false}
|
||||||
${null} | ${false}
|
${null} | ${false}
|
||||||
|
@ -116,7 +116,7 @@ describe('modules/versioning/ubuntu/index', () => {
|
||||||
expect(ubuntu.isSingleVersion(version)).toBe(expected);
|
expect(ubuntu.isSingleVersion(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${undefined} | ${false}
|
${undefined} | ${false}
|
||||||
${null} | ${false}
|
${null} | ${false}
|
||||||
|
@ -197,7 +197,7 @@ describe('modules/versioning/ubuntu/index', () => {
|
||||||
expect(ubuntu.isStable(version)).toBe(expected);
|
expect(ubuntu.isStable(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | expected
|
version | expected
|
||||||
${undefined} | ${false}
|
${undefined} | ${false}
|
||||||
${null} | ${false}
|
${null} | ${false}
|
||||||
|
@ -250,7 +250,7 @@ describe('modules/versioning/ubuntu/index', () => {
|
||||||
expect(ubuntu.isVersion(version)).toBe(expected);
|
expect(ubuntu.isVersion(version)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | major | minor | patch
|
version | major | minor | patch
|
||||||
${undefined} | ${null} | ${null} | ${null}
|
${undefined} | ${null} | ${null} | ${null}
|
||||||
${null} | ${null} | ${null} | ${null}
|
${null} | ${null} | ${null} | ${null}
|
||||||
|
@ -272,7 +272,7 @@ describe('modules/versioning/ubuntu/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'20.04'} | ${'2020.04'} | ${false}
|
${'20.04'} | ${'2020.04'} | ${false}
|
||||||
${'17.10'} | ${'artful'} | ${true}
|
${'17.10'} | ${'artful'} | ${true}
|
||||||
|
@ -287,7 +287,7 @@ describe('modules/versioning/ubuntu/index', () => {
|
||||||
expect(ubuntu.equals(a, b)).toBe(expected);
|
expect(ubuntu.equals(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
a | b | expected
|
a | b | expected
|
||||||
${'20.04'} | ${'20.10'} | ${false}
|
${'20.04'} | ${'20.10'} | ${false}
|
||||||
${'20.10'} | ${'20.04'} | ${true}
|
${'20.10'} | ${'20.04'} | ${true}
|
||||||
|
@ -314,7 +314,7 @@ describe('modules/versioning/ubuntu/index', () => {
|
||||||
expect(ubuntu.isGreaterThan(a, b)).toBe(expected);
|
expect(ubuntu.isGreaterThan(a, b)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['18.10', '19.04', '19.10', '20.04']} | ${'2020.04'} | ${null}
|
${['18.10', '19.04', '19.10', '20.04']} | ${'2020.04'} | ${null}
|
||||||
${['18.10', '19.04', '19.10', '20.04']} | ${'foobar'} | ${null}
|
${['18.10', '19.04', '19.10', '20.04']} | ${'foobar'} | ${null}
|
||||||
|
@ -333,7 +333,7 @@ describe('modules/versioning/ubuntu/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | range | expected
|
versions | range | expected
|
||||||
${['18.10', '19.04', '19.10', '20.04']} | ${'2020.04'} | ${null}
|
${['18.10', '19.04', '19.10', '20.04']} | ${'2020.04'} | ${null}
|
||||||
${['18.10', '19.04', '19.10', '20.04']} | ${'foobar'} | ${null}
|
${['18.10', '19.04', '19.10', '20.04']} | ${'foobar'} | ${null}
|
||||||
|
@ -352,7 +352,7 @@ describe('modules/versioning/ubuntu/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
currentValue | rangeStrategy | currentVersion | newVersion | expected
|
||||||
${undefined} | ${undefined} | ${undefined} | ${'foobar'} | ${'foobar'}
|
${undefined} | ${undefined} | ${undefined} | ${'foobar'} | ${'foobar'}
|
||||||
${'xenial'} | ${undefined} | ${undefined} | ${'20.04'} | ${'focal'}
|
${'xenial'} | ${undefined} | ${undefined} | ${'20.04'} | ${'focal'}
|
||||||
|
@ -373,7 +373,7 @@ describe('modules/versioning/ubuntu/index', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
versions | expected
|
versions | expected
|
||||||
${['17.03', '18.04', '18.04', '6.10', '19.10']} | ${['6.10', '17.03', '18.04', '18.04', '19.10']}
|
${['17.03', '18.04', '18.04', '6.10', '19.10']} | ${['6.10', '17.03', '18.04', '18.04', '19.10']}
|
||||||
${['17.03', 'zesty', 'bionic', 'bionic', 'edgy', 'eoan']} | ${['edgy', '17.03', 'zesty', 'bionic', 'bionic', 'eoan']}
|
${['17.03', 'zesty', 'bionic', 'bionic', 'edgy', 'eoan']} | ${['edgy', '17.03', 'zesty', 'bionic', 'bionic', 'eoan']}
|
||||||
|
@ -381,7 +381,7 @@ describe('modules/versioning/ubuntu/index', () => {
|
||||||
expect(versions.sort(ubuntu.sortVersions)).toEqual(expected);
|
expect(versions.sort(ubuntu.sortVersions)).toEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
version | range | expected
|
version | range | expected
|
||||||
${'20.04'} | ${'2020.04'} | ${false}
|
${'20.04'} | ${'2020.04'} | ${false}
|
||||||
${'20.04'} | ${'20.04'} | ${true}
|
${'20.04'} | ${'20.04'} | ${true}
|
||||||
|
|
|
@ -27,7 +27,7 @@ describe('util/exec/hermit', () => {
|
||||||
findUp.mockClear();
|
findUp.mockClear();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
dir | hermitLocation | expected
|
dir | hermitLocation | expected
|
||||||
${'nested/other/directory'} | ${'nested/bin/hermit'} | ${'nested/bin'}
|
${'nested/other/directory'} | ${'nested/bin/hermit'} | ${'nested/bin'}
|
||||||
${'nested'} | ${'nested/bin/hermit'} | ${'nested/bin'}
|
${'nested'} | ${'nested/bin/hermit'} | ${'nested/bin'}
|
||||||
|
|
|
@ -732,7 +732,7 @@ describe('util/exec/index', () => {
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
test.each(testInputs)('%s', async (_msg, testOpts) => {
|
it.each(testInputs)('%s', async (_msg, testOpts) => {
|
||||||
const {
|
const {
|
||||||
processEnv: procEnv,
|
processEnv: procEnv,
|
||||||
inCmd: cmd,
|
inCmd: cmd,
|
||||||
|
|
|
@ -71,7 +71,7 @@ describe('util/fs/index', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getParentDir', () => {
|
describe('getParentDir', () => {
|
||||||
test.each`
|
it.each`
|
||||||
dir | expected
|
dir | expected
|
||||||
${'/foo/bar/'} | ${'/foo'}
|
${'/foo/bar/'} | ${'/foo'}
|
||||||
${'/foo/bar'} | ${'/foo'}
|
${'/foo/bar'} | ${'/foo'}
|
||||||
|
@ -92,7 +92,7 @@ describe('util/fs/index', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getSiblingFileName', () => {
|
describe('getSiblingFileName', () => {
|
||||||
test.each`
|
it.each`
|
||||||
file | sibling | expected
|
file | sibling | expected
|
||||||
${'/foo/bar'} | ${'baz'} | ${'/foo/baz'}
|
${'/foo/bar'} | ${'baz'} | ${'/foo/baz'}
|
||||||
${'foo/bar'} | ${'baz'} | ${'foo/baz'}
|
${'foo/bar'} | ${'baz'} | ${'foo/baz'}
|
||||||
|
|
|
@ -11,7 +11,7 @@ describe('util/fs/util', () => {
|
||||||
GlobalConfig.set({ localDir, cacheDir });
|
GlobalConfig.set({ localDir, cacheDir });
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
path | fullPath
|
path | fullPath
|
||||||
${''} | ${`${localDir}`}
|
${''} | ${`${localDir}`}
|
||||||
${'baz'} | ${`${localDir}/baz`}
|
${'baz'} | ${`${localDir}/baz`}
|
||||||
|
@ -19,7 +19,7 @@ describe('util/fs/util', () => {
|
||||||
expect(ensureLocalPath(path)).toBe(fullPath);
|
expect(ensureLocalPath(path)).toBe(fullPath);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
path
|
path
|
||||||
${'..'}
|
${'..'}
|
||||||
${'../etc/passwd'}
|
${'../etc/passwd'}
|
||||||
|
@ -30,7 +30,7 @@ describe('util/fs/util', () => {
|
||||||
expect(() => ensureLocalPath(path)).toThrow(FILE_ACCESS_VIOLATION_ERROR);
|
expect(() => ensureLocalPath(path)).toThrow(FILE_ACCESS_VIOLATION_ERROR);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
path | fullPath
|
path | fullPath
|
||||||
${''} | ${`${cacheDir}`}
|
${''} | ${`${cacheDir}`}
|
||||||
${'baz'} | ${`${cacheDir}/baz`}
|
${'baz'} | ${`${cacheDir}/baz`}
|
||||||
|
@ -38,7 +38,7 @@ describe('util/fs/util', () => {
|
||||||
expect(ensureCachePath(path)).toBe(fullPath);
|
expect(ensureCachePath(path)).toBe(fullPath);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
path
|
path
|
||||||
${'..'}
|
${'..'}
|
||||||
${'../etc/passwd'}
|
${'../etc/passwd'}
|
||||||
|
|
|
@ -382,7 +382,7 @@ describe('util/github/graphql/datasource-fetcher', () => {
|
||||||
{ version: v1, releaseTimestamp: t1, foo: '1' },
|
{ version: v1, releaseTimestamp: t1, foo: '1' },
|
||||||
];
|
];
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
isPrivate | isCacheable
|
isPrivate | isCacheable
|
||||||
${undefined} | ${false}
|
${undefined} | ${false}
|
||||||
${true} | ${false}
|
${true} | ${false}
|
||||||
|
|
|
@ -32,7 +32,7 @@ describe('util/github/graphql/util', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
currentTime | initialTimestamp | duration | expected
|
currentTime | initialTimestamp | duration | expected
|
||||||
${'2022-11-25 15:58'} | ${'2022-11-25 15:00'} | ${{ hours: 1 }} | ${false}
|
${'2022-11-25 15:58'} | ${'2022-11-25 15:00'} | ${{ hours: 1 }} | ${false}
|
||||||
${'2022-11-25 15:59'} | ${'2022-11-25 15:00'} | ${{ hours: 1 }} | ${false}
|
${'2022-11-25 15:59'} | ${'2022-11-25 15:00'} | ${{ hours: 1 }} | ${false}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { toMs } from './pretty-time';
|
import { toMs } from './pretty-time';
|
||||||
|
|
||||||
describe('util/pretty-time', () => {
|
describe('util/pretty-time', () => {
|
||||||
test.each`
|
it.each`
|
||||||
input | expected
|
input | expected
|
||||||
${'1h'} | ${1 * 60 * 60 * 1000}
|
${'1h'} | ${1 * 60 * 60 * 1000}
|
||||||
${' 1 h '} | ${1 * 60 * 60 * 1000}
|
${' 1 h '} | ${1 * 60 * 60 * 1000}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { range } from './range';
|
import { range } from './range';
|
||||||
|
|
||||||
describe('util/range', () => {
|
describe('util/range', () => {
|
||||||
test.each`
|
it.each`
|
||||||
start | end | expected
|
start | end | expected
|
||||||
${0} | ${0} | ${[0]}
|
${0} | ${0} | ${[0]}
|
||||||
${0} | ${1} | ${[0, 1]}
|
${0} | ${1} | ${[0, 1]}
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {
|
||||||
} from './url';
|
} from './url';
|
||||||
|
|
||||||
describe('util/url', () => {
|
describe('util/url', () => {
|
||||||
test.each`
|
it.each`
|
||||||
baseUrl | x | result
|
baseUrl | x | result
|
||||||
${'http://foo.io'} | ${''} | ${'http://foo.io'}
|
${'http://foo.io'} | ${''} | ${'http://foo.io'}
|
||||||
${'http://foo.io/'} | ${''} | ${'http://foo.io'}
|
${'http://foo.io/'} | ${''} | ${'http://foo.io'}
|
||||||
|
@ -53,7 +53,7 @@ describe('util/url', () => {
|
||||||
expect(resolveBaseUrl(baseUrl, x)).toBe(result);
|
expect(resolveBaseUrl(baseUrl, x)).toBe(result);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
baseUrl | x | result
|
baseUrl | x | result
|
||||||
${'http://foo.io'} | ${''} | ${'http://foo.io'}
|
${'http://foo.io'} | ${''} | ${'http://foo.io'}
|
||||||
${'http://foo.io/'} | ${''} | ${'http://foo.io'}
|
${'http://foo.io/'} | ${''} | ${'http://foo.io'}
|
||||||
|
|
|
@ -121,7 +121,7 @@ describe('workers/global/config/parse/cli', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
it.each`
|
||||||
arg | config
|
arg | config
|
||||||
${'--endpoints='} | ${{ hostRules: [] }}
|
${'--endpoints='} | ${{ hostRules: [] }}
|
||||||
${'--azure-auto-complete=false'} | ${{ platformAutomerge: false }}
|
${'--azure-auto-complete=false'} | ${{ platformAutomerge: false }}
|
||||||
|
|
|
@ -264,7 +264,7 @@ describe('workers/repository/update/branch/schedule', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('supports timezone', () => {
|
describe('supports timezone', () => {
|
||||||
test.each`
|
it.each`
|
||||||
sched | tz | datetime | expected
|
sched | tz | datetime | expected
|
||||||
${'after 4pm'} | ${'Asia/Singapore'} | ${'2017-06-30T15:59:00.000+0800'} | ${false}
|
${'after 4pm'} | ${'Asia/Singapore'} | ${'2017-06-30T15:59:00.000+0800'} | ${false}
|
||||||
${'after 4pm'} | ${'Asia/Singapore'} | ${'2017-06-30T16:01:00.000+0800'} | ${true}
|
${'after 4pm'} | ${'Asia/Singapore'} | ${'2017-06-30T16:01:00.000+0800'} | ${true}
|
||||||
|
|
Loading…
Reference in a new issue