Created
November 4, 2013 19:30
-
-
Save gcpantazis/7307909 to your computer and use it in GitHub Desktop.
Yeoman templates for specs with templates, Bliss structure.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script id="<%= dashName %>-fixture" type = "text/template"> | |
@Html.Partial("app/modules/<%= dashName %>/html/<%= dashName %>") | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global describe: false, beforeEach: false, afterEach: false, it: false, expect: false */ | |
// <%= titleName %> (<%= className %>) Main Spec | |
// ------------------------------------------------ | |
define(function(require) { | |
'use strict'; | |
var $ = require('jquery'), | |
<%= className %> = require('modules/<%= dashName %>'); | |
describe('The <%= className %> module', function() { | |
var fixture = $('#<%= dashName %>-fixture').html().trim(), | |
Instance, | |
$tester; | |
beforeEach(function() { | |
$tester = $(fixture); | |
Instance = new <%= className %>($tester); | |
}); | |
afterEach(function() { | |
$tester.remove(); | |
Instance = null; | |
}); | |
// START: Class Method Tests | |
it('Initializes the module.', function() { | |
expect(Instance.constructor).to.equal(<%= className %>); | |
}); | |
// END: Class Method Tests | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment