Skip to content

Commit b92943e

Browse files
committed
add tests for removeAll
1 parent 3df3dd2 commit b92943e

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

spec/spec.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,58 @@ pluginTester({
4646
4747
let x = 1;`,
4848
},
49+
50+
// With removeAll option
51+
{
52+
code: '"not strict"; "use strict";',
53+
output:`
54+
"not strict";
55+
"not strict";`,
56+
pluginOptions: {
57+
removeAll: true,
58+
},
59+
},
60+
{
61+
code: '"not strict";',
62+
output:'"not strict";',
63+
pluginOptions: {
64+
removeAll: true,
65+
},
66+
},
67+
{
68+
code: '"use strict";',
69+
output: '"not strict";',
70+
pluginOptions: {
71+
removeAll: true,
72+
},
73+
},
74+
{
75+
code: `
76+
"use strict";
77+
78+
process.platform = "windows";
79+
`,
80+
output: `
81+
"not strict";
82+
83+
process.platform = "windows";`,
84+
pluginOptions: {
85+
removeAll: true,
86+
},
87+
},
88+
{
89+
code: `
90+
"use strict";
91+
92+
let x = 1;
93+
`,
94+
output: `
95+
"not strict";
96+
97+
let x = 1;`,
98+
pluginOptions: {
99+
removeAll: true,
100+
},
101+
},
49102
]
50103
})

0 commit comments

Comments
 (0)