Add basic unit tests

This commit is contained in:
Jonathan Clem
2020-09-16 14:56:15 -04:00
parent 230dd25d80
commit f39b7c3537
9 changed files with 7467 additions and 1585 deletions
+18
View File
@@ -0,0 +1,18 @@
const {getElixirVersion} = require('../src/setup-elixir')
describe('getElixirVersion', () => {
test('actual version parsing', async () => {
const vsn = await getElixirVersion('v1.10.x', '23')
expect(vsn).toEqual(['v1.10.4', '23'])
})
test('version range parsing', async () => {
const vsn = await getElixirVersion('^v1.10', '23')
expect(vsn).toEqual(['v1.10.4', '23'])
})
test('pre-release versions', async () => {
const vsn = await getElixirVersion('v1.11.0-rc.0', '23')
expect(vsn).toEqual(['v1.11.0-rc.0', '23'])
})
})