diff --git a/src/Angular.js b/src/Angular.js index 3789dcbe335e..4dbdc22093a7 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -180,7 +180,8 @@ function forEachSorted(obj, iterator, context) { function formatError(arg) { if (arg instanceof Error) { if (arg.stack) { - arg = arg.stack; + arg = (arg.message && arg.stack.indexOf(arg.message) === -1) ? + 'Error: ' + arg.message + '\n' + arg.stack : arg.stack; } else if (arg.sourceURL) { arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line; } diff --git a/test/BinderSpec.js b/test/BinderSpec.js index e78980d79817..dfa388e3a482 100644 --- a/test/BinderSpec.js +++ b/test/BinderSpec.js @@ -425,10 +425,10 @@ describe('Binder', function(){ it('BindStyle', function(){ var scope = this.compile('
'); - scope.$eval('style={color:"red"}'); + scope.$eval('style={height: "10px"}'); scope.$eval(); - assertEquals("red", scope.$element.css('color')); + assertEquals("10px", scope.$element.css('height')); scope.$eval('style={}'); scope.$eval(); diff --git a/test/directivesSpec.js b/test/directivesSpec.js index 4b2e7055e4e9..e5b8b607f1f8 100644 --- a/test/directivesSpec.js +++ b/test/directivesSpec.js @@ -196,9 +196,9 @@ describe("directive", function(){ describe('ng:style', function(){ it('should set', function(){ - var scope = compile(''); + var scope = compile(''); scope.$eval(); - expect(element.css('color')).toEqual('red'); + expect(element.css('height')).toEqual('40px'); }); it('should silently ignore undefined style', function() { @@ -208,15 +208,15 @@ describe("directive", function(){ }); it('should preserve and remove previous style', function(){ - var scope = compile(''); + var scope = compile(''); scope.$eval(); - expect(getStyle(element)).toEqual({color:'red'}); - scope.myStyle = {color:'blue', width:'10px'}; + expect(getStyle(element)).toEqual({height: '10px'}); + scope.myStyle = {height: '20px', width: '10px'}; scope.$eval(); - expect(getStyle(element)).toEqual({color:'blue', width:'10px'}); + expect(getStyle(element)).toEqual({height: '20px', width: '10px'}); scope.myStyle = {}; scope.$eval(); - expect(getStyle(element)).toEqual({color:'red'}); + expect(getStyle(element)).toEqual({height: '10px'}); }); }); diff --git a/test/scenario/dslSpec.js b/test/scenario/dslSpec.js index f0534c2c87da..4e0042d05e15 100644 --- a/test/scenario/dslSpec.js +++ b/test/scenario/dslSpec.js @@ -273,15 +273,15 @@ describe("angular.scenario.dsl", function() { }); it('should get css', function() { - doc.append(''); - $root.dsl.element('#test').css('border'); - expect($root.futureResult).toMatch(/red/); + doc.append(''); + $root.dsl.element('#test').css('height'); + expect($root.futureResult).toMatch(/30px/); }); it('should set css', function() { - doc.append(''); - $root.dsl.element('#test').css('border', '1px solid green'); - expect(doc.find('#test').css('border')).toMatch(/green/); + doc.append(''); + $root.dsl.element('#test').css('height', '20px'); + expect(doc.find('#test').css('height')).toEqual('20px'); }); it('should add all jQuery key/value methods', function() {