unit testing - WebStorm - How to edit Jasmine code completion snippets -


when writing jasmine unit tests in webstorm (11.0.2), using command + n (os x) command gives me following popup menu:

generate

  • jasmine suite
  • jasmine spec
  • jasmine beforeeach
  • jasmine aftereach

i'd modify code these menu items generate. example, i'm using es6, , change jasmine suite option generate:

describe('suite name', () => { }); 

instead of:

describe('suite name', function () { }); 

i'm digging through webstorm preferences, can't see options modify this. ideas?

i still haven't found way edit code template when using command-n keyboard shortcut, similar functionality can found using "live template", giving complete control of template.

navigate to:

preferences -> editor -> live templates

select javascript option in right pane, , + icon add template.

configuration values:

abbreviation: desc

description: jasmine suite

template text:

describe('$suite_desc$', () => {   $end$ }); 

typing 'desc' tab, generate template. there, can add additional live templates 'it', 'beforeeach' , 'aftereach', using same approach.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -