Skip to content

Instantly share code, notes, and snippets.

@boneskull
Created August 26, 2017 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boneskull/1b9a02cee22aac53dfc872d695f5c26a to your computer and use it in GitHub Desktop.
Save boneskull/1b9a02cee22aac53dfc872d695f5c26a to your computer and use it in GitHub Desktop.
Live templates for Mocha for use in JetBrains' IDEs
<templateSet group="Mocha">
<template name="desc" value="describe('$DESC$', function() {&#10; $END$&#10;});" description="makes a describe block" toReformat="true" toShortenFQNames="true">
<variable name="DESC" expression="jsMethodName()" defaultValue="" alwaysStopAt="true" />
<context>
<option name="JAVA_SCRIPT" value="true" />
</context>
</template>
<template name="be" value="beforeEach(function() {&#10; $END$&#10;});" description="beforeEach" toReformat="true" toShortenFQNames="true">
<context>
<option name="JAVA_SCRIPT" value="true" />
</context>
</template>
<template name="it" value="it('should $DESC$', function() {&#10; $END$&#10;}); " description="makes an it block" toReformat="true" toShortenFQNames="true">
<variable name="DESC" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="JAVA_SCRIPT" value="true" />
</context>
</template>
<template name="ae" value="afterEach(function() {&#10; $END$&#10;});" description="afterEach" toReformat="true" toShortenFQNames="true">
<context>
<option name="JAVA_SCRIPT" value="true" />
</context>
</template>
<template name="a" value="after(function() {&#10; $END$&#10;});" description="after" toReformat="true" toShortenFQNames="true">
<context>
<option name="JAVA_SCRIPT" value="true" />
</context>
</template>
<template name="b" value="before(function() {&#10; $END$&#10;});" description="before" toReformat="true" toShortenFQNames="true">
<context>
<option name="JAVA_SCRIPT" value="true" />
</context>
</template>
</templateSet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment