Skip to content

Commit

Permalink
✅ Fix tests for helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
priestine committed Jul 3, 2020
1 parent e111f7e commit 7737dff
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions test/utils/helpers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,15 @@ test('trimCmdNewLine should remove ending \\n', (t) => {
test('extractVersionTuple should take version tuple from a version string', (t) => {
const tuple: any = extractVersionTuple('1.0.0')
t.is(tuple[0], '1.0.0')
t.is(tuple[1], undefined)
t.is(tuple[2], '1')
t.is(tuple[1], '1')
t.is(tuple[2], '0')
t.is(tuple[3], '0')
t.is(tuple[4], '0')
})

test('extractVersionTuple should handle prefixes', (t) => {
const tuple: any = extractVersionTuple('2020.1.0.0')
t.is(tuple[0], '2020.1.0.0')
t.is(tuple[1], '2020')
t.is(tuple[2], '1')
t.is(tuple[3], '0')
t.is(tuple[4], '0')
})

test('extractVersionTuple should ignore pre-releases and build metadata', (t) => {
const tuple: any = extractVersionTuple('1.0.0-alpha.1+20200101')
t.is(tuple[0], '1.0.0')
t.is(tuple[1], undefined)
t.is(tuple[2], '1')
t.is(tuple[1], '1')
t.is(tuple[2], '0')
t.is(tuple[3], '0')
t.is(tuple[4], '0')
})

0 comments on commit 7737dff

Please sign in to comment.