@@ -51,7 +51,7 @@ test('should remove exports if noEmitExports is true', async (t) => {
51
51
await run ( t , '@value red blue;' , '' , { noEmitExports : true } ) ;
52
52
} ) ;
53
53
54
- test ( 'gives an error when there is no semicolon between lines' , async ( t ) => {
54
+ test ( 'gives a warning when there is no semicolon between lines' , async ( t ) => {
55
55
const input = '@value red blue\n@value green yellow' ;
56
56
const processor = postcss ( [ plugin ] ) ;
57
57
const result = await processor . process ( input , { from : undefined } ) ;
@@ -61,6 +61,16 @@ test('gives an error when there is no semicolon between lines', async (t) => {
61
61
t . expect ( warnings [ 0 ] . text ) . toBe ( 'Invalid value definition: red blue\n@value green yellow' ) ;
62
62
} ) ;
63
63
64
+ test ( 'gives a warning when @value definition is invalid' , async ( t ) => {
65
+ const input = '@value oops:;' ;
66
+ const processor = postcss ( [ plugin ] ) ;
67
+ const result = await processor . process ( input , { from : undefined } ) ;
68
+ const warnings = result . warnings ( ) ;
69
+
70
+ t . expect ( warnings . length ) . toBe ( 1 ) ;
71
+ t . expect ( warnings [ 0 ] . text ) . toBe ( 'Invalid value definition: oops:' ) ;
72
+ } ) ;
73
+
64
74
test ( 'gives an error when path to imported file is wrong' , async ( t ) => {
65
75
const input = '@value red from "./non-existent-file.css"' ;
66
76
const processor = postcss ( [ plugin ] ) ;
@@ -73,12 +83,6 @@ test('gives an error when @value import statement is invalid', async (t) => {
73
83
await t . expect ( processor . process ( input , parserOpts ) ) . rejects . toThrow ( '@value statement "" is invalid!' ) ;
74
84
} ) ;
75
85
76
- test ( 'gives an error when @value declaration is invalid' , async ( t ) => {
77
- const input = '@value oops;' ;
78
- const processor = postcss ( [ plugin ] ) ;
79
- await t . expect ( processor . process ( input , parserOpts ) ) . rejects . toThrow ( 'Invalid @value definition' ) ;
80
- } ) ;
81
-
82
86
test ( 'shouldn\'t break on draft spec syntax' , async ( t ) => {
83
87
await run (
84
88
t ,
0 commit comments