Skip to content

Commit c18861c

Browse files
committed
add tests for extra triggers
1 parent fcb43f7 commit c18861c

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

spec/spec.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,65 @@ pluginTester({
9999
removeAll: true,
100100
},
101101
},
102+
103+
// with extra comment and directive triggers
104+
{
105+
code: `
106+
"use strict";
107+
"use babel";
108+
`,
109+
output: `
110+
"use babel";
111+
`,
112+
pluginOptions: {
113+
directiveTriggers: ['use babel'],
114+
commentTriggers: ['@babel', '@flow', '* @babel', '* @flow'],
115+
},
116+
},
117+
{
118+
code: `
119+
"use strict";
120+
/** @babel */
121+
let x = 1;
122+
`,
123+
output: `
124+
/** @babel */
125+
let x = 1;
126+
`,
127+
pluginOptions: {
128+
directiveTriggers: ['use babel'],
129+
commentTriggers: ['@babel', '@flow', '* @babel', '* @flow'],
130+
},
131+
},
132+
{
133+
code: `
134+
"use strict";
135+
// @babel
136+
let x = 1;
137+
`,
138+
output: `
139+
// @babel
140+
let x = 1;
141+
`,
142+
pluginOptions: {
143+
directiveTriggers: ['use babel'],
144+
commentTriggers: ['@babel', '@flow', '* @babel', '* @flow'],
145+
},
146+
},
147+
{
148+
code: `
149+
"use strict";
150+
// @flow
151+
let x = 1;
152+
`,
153+
output: `
154+
// @flow
155+
let x = 1;
156+
`,
157+
pluginOptions: {
158+
directiveTriggers: ['use babel'],
159+
commentTriggers: ['@babel', '@flow', '* @babel', '* @flow'],
160+
},
161+
},
102162
]
103163
})

0 commit comments

Comments
 (0)