Skip to content

Commit 75ae269

Browse files
committed
add some leading comment/directive tests
1 parent fdcc2cb commit 75ae269

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

spec/spec.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,19 @@ pluginTester({
114114
commentTriggers: ['@babel', '@flow', '* @babel', '* @flow'],
115115
},
116116
},
117+
{
118+
code: `
119+
"use babel";
120+
"use strict";
121+
`,
122+
output: `
123+
"use babel";
124+
`,
125+
pluginOptions: {
126+
directiveTriggers: ['use babel'],
127+
commentTriggers: ['@babel', '@flow', '* @babel', '* @flow'],
128+
},
129+
},
117130
{
118131
code: `
119132
"use strict";
@@ -159,5 +172,41 @@ pluginTester({
159172
commentTriggers: ['@babel', '@flow', '* @babel', '* @flow'],
160173
},
161174
},
175+
{
176+
code: `
177+
// @flow
178+
"use strict";
179+
`,
180+
output: ``,
181+
pluginOptions: {
182+
directiveTriggers: ['use babel'],
183+
commentTriggers: ['@babel', '@flow', '* @babel', '* @flow'],
184+
},
185+
},
186+
{
187+
code: `
188+
// @babel
189+
// @flow
190+
"use strict";
191+
`,
192+
output: ``,
193+
pluginOptions: {
194+
directiveTriggers: ['use babel'],
195+
commentTriggers: ['@babel', '@flow', '* @babel', '* @flow'],
196+
},
197+
},
198+
{
199+
code: `
200+
// @babel
201+
"use strict";
202+
// @flow
203+
`,
204+
output: `
205+
`,
206+
pluginOptions: {
207+
directiveTriggers: ['use babel'],
208+
commentTriggers: ['@babel', '@flow', '* @babel', '* @flow'],
209+
},
210+
},
162211
]
163212
})

0 commit comments

Comments
 (0)