Skip to content

Commit

Permalink
unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Conduitry committed Apr 10, 2017
1 parent 4fe0365 commit 86035c3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/validator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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( '<div></div>', {
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 } ] );
});
});

0 comments on commit 86035c3

Please sign in to comment.