Skip to content

Commit

Permalink
fix directive test because of newly used $templateCache
Browse files Browse the repository at this point in the history
  • Loading branch information
dkern committed Nov 11, 2015
1 parent 9f4f8eb commit 4cdb7f1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "angular-best-practice",
"description": "This is a best practice AngularJS package.",
"version": "0.1.4",
"version": "0.1.5",
"homepage": "https://github.com/eisbehr-/angular-best-practice",
"authors": [{
"name": "Daniel 'Eisbehr' Kern",
Expand Down
7 changes: 5 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ module.exports = function(config) {
// app - module definitions first
'app/**/*.module.js',
'app/**/*.js',
// templates
'app/**/*.html',
// tests
'tests/**/*.spec.js'
],
Expand All @@ -29,7 +31,9 @@ module.exports = function(config) {

// pre-process matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {},
preprocessors: {
'app/examples/**/*.html': 'html2js'
},

// test results reporter to use
// possible values: 'dots', 'progress'
Expand Down Expand Up @@ -57,7 +61,6 @@ module.exports = function(config) {
browsers: [
'Chrome',
'Firefox',
//'Safari',
'PhantomJS'
],

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-best-practice",
"version": "0.1.4",
"version": "0.1.5",
"title": "AngularJS - Best Practice",
"description": "This is a best practice AngularJS package.",
"homepage": "https://github.com/eisbehr-/angular-best-practice",
Expand Down
11 changes: 4 additions & 7 deletions tests/unit/directives/directives.controller.directive.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@ describe("when using controller directive", function()
var controller;

beforeEach(module("practice.directives"));
beforeEach(inject(function($rootScope, $compile, $httpBackend) {
beforeEach(inject(function($rootScope, $compile) {
var element = angular.element("<controller-directive format='test'></controller-directive>");
var scope = $rootScope.$new();
var scope = $rootScope;

$httpBackend.expect("GET", "examples/directives/directives.controller.directive.tpl.html")
.respond(200);
$compile(element)(scope);
$rootScope.$digest();

scope = element.isolateScope() || element.scope();
$httpBackend.flush();
controller = scope.$$childTail.controller;

controller = scope.controller;
}));

it("should have a date", function() {
Expand Down

0 comments on commit 4cdb7f1

Please sign in to comment.