Skip to content

Instantly share code, notes, and snippets.

@gcpantazis
Created November 4, 2013 19:30
Show Gist options
  • Save gcpantazis/7307909 to your computer and use it in GitHub Desktop.
Save gcpantazis/7307909 to your computer and use it in GitHub Desktop.
Yeoman templates for specs with templates, Bliss structure.
<script id="<%= dashName %>-fixture" type = "text/template">
@Html.Partial("app/modules/<%= dashName %>/html/<%= dashName %>")
</script>
/* 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