Commit Graph

88 Commits

Author SHA1 Message Date
Loïc Bourgois
e585c7505f Log gulp error to Chart.js (#5143)
* Log errors and skip for buildTask

* Write gulp error to Chart.js
+ Add intentional error to core to check if travis fails

* Remove unused require

* Remove error + Proper require fs

* Fix newline

* Refactor

* Put back browser errors

* Use options

* Fix intentional error

* Use yargs + Refactor

* remove space

* Fefactor

* Use booleans
2018-01-13 12:17:38 -05:00
Simon Brunel
fcd463354b
Update license year and copyright holders (#5053) 2017-12-31 15:17:22 +01:00
andig
8dca88c7d5 Fix tests on OSX with retina screen
* Fix retina unit test failures
* Honor config file formatting
* Prevent gulp error on non-zero karma result
2017-08-05 10:48:12 -04:00
Simon Brunel
4c763bff44 Enforce spaces around infix/unary words operators (#4547)
Enable ESLint `space-infix-ops` and `space-unary-ops` (for words only) rules. Also added `samples` to the linting task to match Code Climate expectations.

http://eslint.org/docs/rules/space-infix-ops
http://eslint.org/docs/rules/space-unary-ops
2017-07-22 14:13:09 +02:00
Simon Brunel
ecca3373b2 Increase ESLint complexity and add config for tests (#4421)
Raise the cyclomatic complexity to 10 which seems to better match the project coding style and still reasonable (6 being quite low). Also move unit tests specific eslint rules in the cascaded `./test/.eslintrc` file (previously in `gulp.js`).
2017-07-01 09:55:11 +02:00
Ben McCann
75791988d3 Upgrade dependencies 2017-05-27 10:54:08 -04:00
Simon Brunel
e3f3b8978b Add gulp unittest --coverage argument (#4075)
Coverage data are now generated by running `gulp unittest` with the `--coverage` argument: unit tests are then executed a single time on Travis. The gulp `coverage` task has been removed and `karma.coverage.conf.ci.js` merged into `karma.conf.ci.js`.

Update documentation with gulp commands (and remove them from `README.md`) and remove unused `config.jshintrc` (oversight from #3256). Delete `thankyou.md` which has been merged into `README.md`.
2017-03-25 18:26:45 +01:00
Evert Timberg
3e94b9431a Update the docs structure/content to use GitBook (#3751)
Update the docs structure/content to use GitBook
2017-03-20 20:36:54 -04:00
Simon Brunel
1ca0ffb5d5 Introduce unit test based on image comparison (#3988)
Attempt to make easier the creation of unit tests that check the drawing output. Until now, this was done by checking calls on a 'fake' context, which is hard to maintain (need to update pixel values by hands) and also not reliable when optimizing code (i.e. different calls sequence but same result).

As of now, it's possible to define 'auto' tests based on JSON/PNG fixtures: chart is generated from the JSON file and compared to the associated PNG image. The image diff is done using `pixelmatch`. As an example (and in preparation of the `filler` plugin), add auto tests for the line element `fill` options.
2017-03-05 09:49:12 -07:00
Simon Brunel
c216c0af76 Cleanup and upgrade unit tests environment
`karma.conf.ci.js` has been merged into `karma.conf.js` for local testing consistency: `gulp unittestWatch` has been replaced by `gulp unittest --watch` and thus use exactly the same config file. Upgrade to latest jasmine and karma packages and remove deprecated `gulp-karma` dependency (directly use `karma.Server` in gulp).

Split `test/mockContext.js` into smaller `test/jasmine.*` modules to make easier unit tests maintenance and finally, move all `*.test.js` files under the `test/specs` folder.
2017-03-04 11:39:48 -05:00
Simon Brunel
ceec907bee Ignore .gitignore (and more) from Bower packages 2017-01-22 10:31:02 -05:00
Jake
7c3e71d58b update copyright date 2017-01-02 13:26:51 -05:00
Zach Panzarino
a0ce74643f Fix eslint errors in layout service test 2016-10-18 22:00:55 +00:00
etimberg
596ff3718c Layout service now supports configurable padding on left, top, right and bottom.
Re-enabled the layout service tests and then properly disabled the tests that
fail on the CI.
2016-10-17 16:59:47 -05:00
Zach Panzarino
766ca49cd0 Extend eslint to test files (#3473)
* Add eslint to test files

* Fix mockContext for tests

* Make formatting look better for nested objects
2016-10-16 17:34:59 -04:00
Simon Brunel
d407da4e36 Merge pull request #3325 from chartjs/fix/3269
Improve multiline labeling for tooltips in doughnut charts
2016-09-24 22:31:29 +02:00
Evert Timberg
9041b5a2b9 Update default config tests and re-enable 2016-09-24 22:25:05 +02:00
Simon Brunel
8ec7ce2f93 Gulp command switch to run specific test files
Add the --inputs command switch to the unittest and unittestWatch tasks, to be able to run unit tests from the specified files only (e.g. gulp unittest --inputs=test/core.element.tests.js;test/core.helpers.tests.js).
2016-09-23 17:47:33 +02:00
Simon Brunel
69ab0d3e23 Use gulp-eslint instead of gulp-jshint
Change the linter in gulp tasks to be consistent with Code Climate results which are based on ESLint using .eslintrc options. However, defaults Code Climate rules are too strict, so turn as warnings the 'complexity' and 'max-statements' rules (other errors has been fixed). Note that the Gulp task name has been changed for `gulp lint`.
2016-09-03 18:42:22 +02:00
Simon Brunel
594605c5c4 Remove deprecated gulp tasks and dependencies 2016-08-30 00:04:40 +02:00
Simon Brunel
cd50edbc84 #3182 Gulp task to generate bower.json file 2016-08-28 18:21:10 +02:00
Simon Brunel
6572c94bd6 Fix missing Chart.js.zip file for Travis release 2016-07-15 13:01:55 +02:00
Simon Brunel
c6318749da Drop official support for Bower
Remove the bower.json file and update the documentation with the alternative bower-npm-resolver solution.
2016-06-18 12:18:30 +02:00
Simon Brunel
53a0c5442e New Chart.js.zip package
Samples need to be packaged with built libraries (which one have been removed from the repository), so create a new `gulp package` task to generate a ZIP archive with dist files, samples and the license file. This archive is generated in the ./dist/ folder and will be deployed by Travis along the GH release. Note that the ./dist/ folder is not preserved but merged in the archive root. Also change samples requiring moment.js to load this lib from the CDN instead of the ./node_module folder.
2016-06-18 12:14:31 +02:00
Simon Brunel
5c56f5cd9d Use bundle-collapser to reduce build size
This browserify plugin converts required string paths to int (see https://github.com/substack/bundle-collapser), lowering our *.min.js by ~1.8KB.
2016-06-05 09:56:41 +02:00
Eric D. Lewis
204021007f Amend build task with flag for AMD compatible builds (#2298) 2016-06-03 20:21:49 -04:00
Zach Panzarino
050a6cb7c0 Clean up gulpfile even more 2016-05-24 15:04:20 +00:00
Zach Panzarino
cd7b975c95 Clean up gulpfile 2016-05-24 13:02:02 +00:00
Zach Panzarino
5a79b42a46 Update CDN on bump 2016-05-10 15:12:22 +00:00
Zach Panzarino
27b6791e73 Fix build to remove all comments other than header 2016-05-04 22:54:10 +00:00
Zach Panzarino
2c77f1b065 Enable line tests 2016-04-28 23:05:18 +00:00
Evert Timberg
73bc52f196 Update radial linear tests 2016-04-28 18:28:57 -04:00
Evert Timberg
9fe9305992 Reenable time scale tests 2016-04-27 21:50:31 -04:00
Evert Timberg
5c146a9da5 Linear scale tests 2016-04-27 21:19:02 -04:00
Evert Timberg
405fda6655 Fix radar tests & reenable. support new lineTension attribute like line controller 2016-04-27 19:03:52 -04:00
Evert Timberg
40405ebc80 disable time tests for same reason as others 2016-04-27 17:45:39 -04:00
Simon Brunel
eb14481d02 Fix legend tests and disable other failing tests 2016-04-27 19:58:36 +02:00
Zach Panzarino
0420965b49 Update gulpfile.js 2016-04-25 13:18:25 -04:00
Zach Panzarino
900d249646 Fix build to include comment at top of file 2016-04-22 15:03:52 +00:00
Zach Panzarino
fdec346206 Fix case-sensitive error in gulpfile 2016-04-20 23:42:07 +00:00
etimberg
a84f9d9177 Update other test tasks to use karma-browserify 2016-02-13 21:58:49 -05:00
etimberg
96551c20db begin fixing coverage tests 2016-02-13 21:50:12 -05:00
etimberg
f6951816a0 Improve joshing reporting. Added a JSHint config file.
Fixed JSHint warnings.
2016-02-13 20:12:26 -05:00
Tanner Linsley
999125c521 Testing for the new build system 2016-02-11 23:25:06 -07:00
Tanner Linsley
813d18bd78 Passing All Tests, Updated Dependencies 2016-02-11 23:16:43 -07:00
Tanner Linsley
007d029837 Bundled builds
Possible usages are:

src/Chart.js (umd)
dist/Chart.js (ChartJS)
dist/Chart.min.js (ChartJS minified)
dist/Chart.bundle.js (ChartJS with Moment.js)
dist/Chart.bundle.min.js (ChartJS with Moment.js minified)
2016-02-11 21:29:26 -07:00
Tanner Linsley
f2780bb825 Browserify for easier UMD consumptions and vanilla builds 2016-02-11 20:30:53 -07:00
Kirushanth Sakthivetpillai
1e91cf816b Update gulpfile.js
root can be either window, globals but without this, JS will not lookup in globals object
2016-01-05 11:19:48 -05:00
Tanner Linsley
ac9fe08068 Offer window alternative to this context. Fixes Webspack and Browserify support 2015-12-30 09:43:51 -07:00
Kriss
1221d8311a gulp-umd
Explicitly pass root to the factory function.
2015-12-22 13:21:23 +00:00