Skip to content

Instantly share code, notes, and snippets.

@tregusti
Last active December 15, 2015 10:29
Show Gist options
  • Save tregusti/5245552 to your computer and use it in GitHub Desktop.
Save tregusti/5245552 to your computer and use it in GitHub Desktop.
Snippets for qv.testCase testing

To use them, add the *.snippet files to: C:\Users\<username>\Documents\Visual Studio 2012\Code Snippets\JavaScript\My Code Snippets.

The use the following tab completions:

  • sho
  • test
  • qvt
<CodeSnippet Format="1.1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<Header>
<Title>qv.testCase</Title>
<Author>Glenn Jorde</Author>
<Shortcut>qvt</Shortcut>
<Description>Snippet for a qv.testCase</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>name</ID>
<ToolTip>Describe the subject under test</ToolTip>
<Default>Test case name</Default>
</Literal>
<Literal>
<ID>path</ID>
<Default>path/to/module</Default>
</Literal>
</Declarations>
<Code Key="*" Language="JavaScript">
<![CDATA[qv.testCase( "$name$", {
modules: ["$path$"],
stubs: {}
}, {
setUp: function() {
},
tearDown: function() {
},
$end$
} );]]></Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<Header>
<Title>should</Title>
<Author>Glenn Jorde</Author>
<Shortcut>sho</Shortcut>
<Description>Markup snippet for a qv-testcase test</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>name</ID>
<ToolTip>Test name</ToolTip>
<Default>be true</Default>
</Literal>
<Literal>
<ID>comma</ID>
<Default>,</Default>
</Literal>
</Declarations>
<Code Key="*" Language="JavaScript"><![CDATA["should $name$": function() {
// Arrange
// Act
$end$
// Assert
}$comma$]]></Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<Header>
<Title>test</Title>
<Author>Glenn Jorde</Author>
<Shortcut>test</Shortcut>
<Description>Snippet for a TestCase test</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>name</ID>
<ToolTip>Test name</ToolTip>
<Default>be true</Default>
</Literal>
<Literal>
<ID>comma</ID>
<Default>,</Default>
</Literal>
</Declarations>
<Code Key="*" Language="JavaScript"><![CDATA["test should $name$": function() {
// Arrange
// Act
$end$
// Assert
}$comma$]]></Code>
</Snippet>
</CodeSnippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment