-
Notifications
You must be signed in to change notification settings - Fork 1
/
migrateRuleNames.test.js
51 lines (47 loc) · 1.37 KB
/
migrateRuleNames.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const migrateRuleNames = require("./utils/migrateRuleNames");
describe("migrateRuleNames", () => {
it("should migrate deprecated *-blacklist to *-disallowed-list", () => {
expect(
migrateRuleNames({
"property-blacklist": true,
"selector-combinator-blacklist": false,
}),
).toEqual({
"property-disallowed-list": true,
"selector-combinator-disallowed-list": false,
});
});
it("should migrate deprecated *-whitelist to *-allowed-list", () => {
expect(
migrateRuleNames({
"property-whitelist": true,
"selector-combinator-whitelist": false,
}),
).toEqual({
"property-allowed-list": true,
"selector-combinator-allowed-list": false,
});
});
it("should migrate deprecated *-requirelist to *-required-list", () => {
expect(
migrateRuleNames({
"at-rule-property-requirelist": true,
}),
).toEqual({
"at-rule-property-required-list": true,
});
});
it("should migrate a mix of deprecated rule names", () => {
expect(
migrateRuleNames({
"selector-combinator-blacklist": false,
"at-rule-property-requirelist": true,
"property-whitelist": true,
}),
).toEqual({
"selector-combinator-disallowed-list": false,
"at-rule-property-required-list": true,
"property-allowed-list": true,
});
});
});