From 86035c3f9916bf4dec9e27a3f722a1df5061c805 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Mon, 10 Apr 2017 18:56:55 -0400 Subject: [PATCH] unit test --- test/validator/index.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/validator/index.js b/test/validator/index.js index 9b88441f34..8ebe0be294 100644 --- a/test/validator/index.js +++ b/test/validator/index.js @@ -69,4 +69,19 @@ describe( 'validate', () => { }); }, /options\.name must be a valid identifier/ ); }); + + it( 'warns if options.name is not capitalised', () => { + const warnings = []; + svelte.compile( '
', { + name: 'lowercase', + onwarn ( warning ) { + warnings.push({ + message: warning.message, + pos: warning.pos, + loc: warning.loc + }); + } + }); + assert.deepEqual( warnings, [ { message: 'options.name should be capitalised', pos: undefined, loc: undefined } ] ); + }); });