1
1
import {
2
2
getCurrentVersion ,
3
- getDeprecatedSelectors ,
4
- getDeprecatedVariables ,
5
3
getPackageStats ,
6
4
getSelectorDiff ,
7
5
getVariableDiff
@@ -10,17 +8,6 @@ import semver from 'semver'
10
8
11
9
let selectorsDiff , variablesDiff , version
12
10
13
- // Because of a change in analyzer this was incorrectly in the list
14
- const variableAllowList = [ '$marketing-all-spacers' ]
15
- const selectorAllowList = [
16
- '.Truncate .Truncate-text' ,
17
- '.Truncate .Truncate-text+.Truncate-text' ,
18
- '.Truncate .Truncate-text.Truncate-text--expandable:active' ,
19
- '.Truncate .Truncate-text.Truncate-text--expandable:focus' ,
20
- '.Truncate .Truncate-text.Truncate-text--expandable:hover' ,
21
- '.Truncate .Truncate-text.Truncate-text--primary'
22
- ]
23
-
24
11
beforeAll ( async ( ) => {
25
12
selectorsDiff = getSelectorDiff ( )
26
13
variablesDiff = getVariableDiff ( )
@@ -33,48 +20,3 @@ describe('css', () => {
33
20
expect ( supportStats . size ) . toEqual ( 0 )
34
21
} )
35
22
} )
36
-
37
- describe ( 'deprecations' , ( ) => {
38
- it ( 'A selector was marked as deprecated but not removed from the codebase' , ( ) => {
39
- const removed = selectorsDiff [ 'removed' ]
40
- const deprecations = getDeprecatedSelectors ( version . raw )
41
- if ( deprecations . length ) {
42
- // Selectors were marked to be deprecated in this version,
43
- // but were not removed from the codebase. Please remove these selectors.
44
- expect ( deprecations . sort ( ) ) . toEqual ( removed . sort ( ) ) // eslint-disable-line jest/no-conditional-expect
45
- }
46
- } )
47
-
48
- it ( 'A selector was removed from the codebase but not added to upcoming major release deprecations file.' , ( ) => {
49
- const removedSelectors = selectorsDiff [ 'removed' ] . filter ( v => ! selectorAllowList . includes ( v ) )
50
-
51
- if ( version . minor !== 0 && version . patch !== 0 ) {
52
- const nextMajor = semver . inc ( version . raw , 'major' )
53
- const deprecations = getDeprecatedSelectors ( nextMajor )
54
- // Some classes were removed from the codebase, but not found
55
- // in the next upcoming major release deprecation.js
56
- expect ( deprecations . sort ( ) ) . toEqual ( expect . arrayContaining ( removedSelectors . sort ( ) ) ) // eslint-disable-line jest/no-conditional-expect
57
- }
58
- } )
59
-
60
- it ( 'A variable was marked as deprecated but not removed from the codebase' , ( ) => {
61
- const removed = variablesDiff . removed
62
- const deprecations = getDeprecatedVariables ( version . raw )
63
- if ( deprecations . length ) {
64
- // Variables were marked to be deprecated in this version,
65
- // but were not removed from the codebase. Please remove these variables.
66
- expect ( deprecations . sort ( ) ) . toEqual ( removed . sort ( ) ) // eslint-disable-line jest/no-conditional-expect
67
- }
68
- } )
69
-
70
- it ( 'A variable was removed from the codebase and added to upcoming major release deprecations file.' , ( ) => {
71
- const removed = variablesDiff . removed . filter ( v => ! variableAllowList . includes ( v ) )
72
- if ( version . minor !== 0 && version . patch !== 0 ) {
73
- const nextMajor = semver . inc ( version . raw , 'major' )
74
- const deprecations = getDeprecatedVariables ( nextMajor )
75
- // Some variables were removed from the codebase, but not found
76
- // in the next upcoming major release deprecation.json
77
- expect ( deprecations ) . toEqual ( expect . arrayContaining ( removed ) ) // eslint-disable-line jest/no-conditional-expect
78
- }
79
- } )
80
- } )
0 commit comments