-
Notifications
You must be signed in to change notification settings - Fork 66.9k
Expand file tree
/
Copy pathversions.js
More file actions
23 lines (20 loc) · 923 Bytes
/
versions.js
File metadata and controls
23 lines (20 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { jest } from '@jest/globals'
import revalidator from 'revalidator'
import { allVersions } from '../../lib/all-versions.js'
import { latest } from '../../lib/enterprise-server-releases.js'
import schema from '../helpers/schemas/versions-schema.js'
import nonEnterpriseDefaultVersion from '../../lib/non-enterprise-default-version.js'
jest.useFakeTimers({ legacyFakeTimers: true })
describe('versions module', () => {
test('is an object with versions as keys', () => {
expect(nonEnterpriseDefaultVersion in allVersions).toBe(true)
expect(`enterprise-server@${latest}` in allVersions).toBe(true)
})
test('every version is valid', () => {
Object.values(allVersions).forEach((versionObj) => {
const { valid, errors } = revalidator.validate(versionObj, schema)
const expectation = JSON.stringify({ versionObj, errors }, null, 2)
expect(valid, expectation).toBe(true)
})
})
})