Skip to content

Commit 692c89f

Browse files
committed
unit test
1 parent 4fe0365 commit 692c89f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/validator/index.js

+15
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,19 @@ describe( 'validate', () => {
6969
});
7070
}, /options\.name must be a valid identifier/ );
7171
});
72+
73+
it( 'warns if options.name is not capitalized', () => {
74+
const warnings = [];
75+
svelte.compile( '<div></div>', {
76+
name: 'lowercase',
77+
onwarn ( warning ) {
78+
warnings.push({
79+
message: warning.message,
80+
pos: warning.pos,
81+
loc: warning.loc
82+
});
83+
}
84+
});
85+
assert.deepEqual( warnings, [ { message: 'options.name should be capitalised', pos: undefined, loc: undefined } ] );
86+
});
7287
});

0 commit comments

Comments
 (0)