File tree 1 file changed +32
-0
lines changed
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -1295,6 +1295,38 @@ describe('Parsing themes values from CSS', () => {
1295
1295
} )
1296
1296
1297
1297
describe ( 'plugins' , ( ) => {
1298
+ test ( '@plugin need a path' , ( ) =>
1299
+ expect (
1300
+ compile (
1301
+ css `
1302
+ @plugin ;
1303
+ ` ,
1304
+ {
1305
+ loadPlugin : async ( ) => {
1306
+ return ( { addVariant } : PluginAPI ) => {
1307
+ addVariant ( 'hocus' , '&:hover, &:focus' )
1308
+ }
1309
+ } ,
1310
+ } ,
1311
+ ) ,
1312
+ ) . rejects . toThrowErrorMatchingInlineSnapshot ( `[Error: \`@plugin\` must have a path.]` ) )
1313
+
1314
+ test ( '@plugin can not have an empty path' , ( ) =>
1315
+ expect (
1316
+ compile (
1317
+ css `
1318
+ @plugin '';
1319
+ ` ,
1320
+ {
1321
+ loadPlugin : async ( ) => {
1322
+ return ( { addVariant } : PluginAPI ) => {
1323
+ addVariant ( 'hocus' , '&:hover, &:focus' )
1324
+ }
1325
+ } ,
1326
+ } ,
1327
+ ) ,
1328
+ ) . rejects . toThrowErrorMatchingInlineSnapshot ( `[Error: \`@plugin\` must have a path.]` ) )
1329
+
1298
1330
test ( '@plugin cannot be nested.' , ( ) =>
1299
1331
expect (
1300
1332
compile (
You can’t perform that action at this time.
0 commit comments