Skip to content

Commit ecc9aab

Browse files
committed
feat(testing): add test for constants "version"
1 parent 2a4c14f commit ecc9aab

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/unit/constants.test.ts

+13
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,26 @@ describe("constants", () => {
3636
})
3737
})
3838
describe("version", () => {
39+
40+
beforeAll(() => {
41+
// create tmpdir and add package.json
42+
})
43+
44+
afterAll(() => {
45+
// clean up
46+
})
3947
it("should return the package.json version", () => {
4048
// Source: https://gist.github.com/jhorsman/62eeea161a13b80e39f5249281e17c39#gistcomment-2896416
4149
const validSemVar = new RegExp("^(0|[1-9]d*).(0|[1-9]d*).(0|[1-9]d*)")
4250
const isValidSemVar = validSemVar.test(version)
4351
expect(version).not.toBe(null)
4452
expect(isValidSemVar).toBe(true)
4553
})
54+
it("should return 'development' if package.json version is missing", () => {
55+
// TODO
56+
57+
expect(version).toBe("development")
58+
})
4659
})
4760

4861
describe("commit", () => {

0 commit comments

Comments
 (0)