1
1
mirror of https://github.com/primer/css.git synced 2024-12-24 22:53:58 +03:00
css/__tests__/css.test.js

34 lines
891 B
JavaScript
Raw Normal View History

import {
2021-04-01 09:11:55 +03:00
getCurrentVersion,
getPackageStats,
2021-04-01 09:11:55 +03:00
getSelectorDiff,
getVariableDiff,
currentVersionDeprecations
} from './utils/css'
import semver from 'semver'
2021-04-01 00:53:15 +03:00
2021-04-01 09:11:55 +03:00
let selectorsDiff, variablesDiff, version
beforeAll(async () => {
selectorsDiff = getSelectorDiff()
variablesDiff = getVariableDiff()
version = getCurrentVersion()
})
describe('css', () => {
it('The support.css file contains no compiled css', () => {
const supportStats = getPackageStats('support')
expect(supportStats.size).toEqual(0)
})
})
describe('deprecations', () => {
it('expects deprecations and their replacement to not be equal.', () => {
const deprecations = currentVersionDeprecations()
Object.keys(deprecations["selectors"]).forEach(deprecation => {
const replacement = deprecations["selectors"][deprecation]
expect(deprecation).not.toEqual(replacement)
})
})
})