Skip to content

Commit 8695c50

Browse files
committed
#338 - Fix test for angular 1.5.x and officially support angular 1.5.x
1 parent a684d05 commit 8695c50

5 files changed

Lines changed: 11 additions & 13 deletions

File tree

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
"tests"
4040
],
4141
"dependencies": {
42-
"angular": "1.4.x",
42+
"angular": "1.x",
4343
"Chart.js": "~1.1.1"
4444
},
4545
"devDependencies": {
4646
"Chart.StackedBar.js": "~1.0.1",
4747
"angular-bootstrap": "~0.11.0",
48-
"angular-mocks": "1.4.x",
48+
"angular-mocks": "~1.x",
4949
"font-awesome": "~4.1.0",
5050
"rainbow": "~1.1.9",
5151
"requirejs": "~2.1.20"

examples/charts.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ <h3>Dependencies</h3>
7878
This repository contains a set of <strong>native AngularJS directives</strong> for Chart.js. The <strong>only required dependencies</strong> are:
7979
</p>
8080
<ul>
81-
<li><a href="http://angularjs.org" target="_blank">AngularJS</a> (tested with 1.2.x, 1.3.x and 1.4.x although it probably works with older versions)</li>
82-
<li><a href="http://chartjs.org" target="_blank">Chart.js</a> (requires Chart.js 1.0, tested with version 1.0.1 and 1.0.2).</li>
81+
<li><a href="http://angularjs.org" target="_blank">AngularJS</a> (tested with 1.2.x, 1.3.x, 1.4.x and 1.5.x although it probably works with older versions)</li>
82+
<li><a href="http://chartjs.org" target="_blank">Chart.js</a> (requires Chart.js 1.x, tested with version 1.0.1, 1.0.2 and 1.1.1).</li>
8383
</ul>
8484
<h3>Files to download</h3>
8585
<p>

examples/charts.template.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ <h3>Dependencies</h3>
7878
This repository contains a set of <strong>native AngularJS directives</strong> for Chart.js. The <strong>only required dependencies</strong> are:
7979
</p>
8080
<ul>
81-
<li><a href="http://angularjs.org" target="_blank">AngularJS</a> (tested with 1.2.x, 1.3.x and 1.4.x although it probably works with older versions)</li>
82-
<li><a href="http://chartjs.org" target="_blank">Chart.js</a> (requires Chart.js 1.0, tested with version 1.0.1 and 1.0.2).</li>
81+
<li><a href="http://angularjs.org" target="_blank">AngularJS</a> (tested with 1.2.x, 1.3.x, 1.4.x and 1.5.x although it probably works with older versions)</li>
82+
<li><a href="http://chartjs.org" target="_blank">Chart.js</a> (requires Chart.js 1.x, tested with version 1.0.1, 1.0.2 and 1.1.1).</li>
8383
</ul>
8484
<h3>Files to download</h3>
8585
<p>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"webshot": "^0.18.0"
5656
},
5757
"dependencies": {
58-
"angular": "^1.4.5",
58+
"angular": "1.x",
5959
"chart.js": "^1.1.1"
6060
}
6161
}

test/test.unit.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,14 @@ describe('Unit testing', function () {
124124
[28, 48, 40, 19, 86, 27, 90]
125125
];
126126

127-
var mock = sandbox.mock(scope);
127+
var spy = sandbox.spy(scope, '$watch');
128+
$compile(markup)(scope);
129+
128130
// cannot get a hold of the child scope as it isn't created yet
129131
// so cannot be more precise on expectations
130132
/* whummer: due to new attribute names (chart-*), only the attributes
131133
which are actually present in the markup will be updated via $watch (3) */
132-
mock.expects('$watch').atLeast(3);
133-
134-
$compile(markup)(scope);
135-
136-
mock.verify();
134+
expect(spy.calledThrice).to.be.true;
137135
});
138136

139137
it('creates the chart only once', function () {

0 commit comments

Comments
 (0)