Skip to content

Commit

Permalink
Merge pull request #3285 from plotly/test-ie-on-appveyor
Browse files Browse the repository at this point in the history
Add (some) IE11 testing on AppVeyor
  • Loading branch information
etpinard authored Nov 26, 2018
2 parents 75516a4 + 50218de commit 1e1495f
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 8 deletions.
14 changes: 14 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
environment:
nodejs_version: "10"

install:
- ps: Install-Product node $env:nodejs_version
# faster than `npm install`
- npm ci

test_script:
- node --version
- npm --version
- npm run test-jasmine -- lib --IE11

build: off
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"karma-chrome-launcher": "^2.0.0",
"karma-fail-fast-reporter": "^1.0.5",
"karma-firefox-launcher": "^1.0.1",
"karma-ie-launcher": "^1.0.0",
"karma-jasmine": "^1.1.2",
"karma-jasmine-spec-tags": "^1.0.1",
"karma-spec-reporter": "0.0.32",
Expand Down
7 changes: 5 additions & 2 deletions test/jasmine/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ var path = require('path');
var minimist = require('minimist');
var constants = require('../../tasks/util/constants');

var isCI = !!process.env.CIRCLECI;
var isCI = !!process.env.CI;
var argv = minimist(process.argv.slice(4), {
string: ['bundleTest', 'width', 'height'],
'boolean': ['info', 'nowatch', 'failFast', 'verbose', 'Chrome', 'Firefox'],
'boolean': ['info', 'nowatch', 'failFast', 'verbose', 'Chrome', 'Firefox', 'IE11'],
alias: {
'Chrome': 'chrome',
'Firefox': ['firefox', 'FF'],
'IE11': ['ie11'],
'bundleTest': ['bundletest', 'bundle_test'],
'nowatch': 'no-watch',
'failFast': 'fail-fast'
Expand Down Expand Up @@ -54,6 +55,7 @@ if(argv.info) {
' - `--info`: show this info message',
' - `--Chrome` (alias `--chrome`): run test in (our custom) Chrome browser',
' - `--Firefox` (alias `--FF`, `--firefox`): run test in (our custom) Firefox browser',
' - `--IE11` (alias -- `ie11`)`: run test in IE11 browser',
' - `--nowatch (dflt: `false`, `true` on CI)`: run karma w/o `autoWatch` / multiple run mode',
' - `--failFast` (dflt: `false`): exit karma upon first test failure',
' - `--verbose` (dflt: `false`): show test result using verbose reporter',
Expand Down Expand Up @@ -302,6 +304,7 @@ func.defaultConfig.files.push(testFileGlob);
var browsers = func.defaultConfig.browsers;
if(argv.Chrome) browsers.push('_Chrome');
if(argv.Firefox) browsers.push('_Firefox');
if(argv.IE11) browsers.push('IE');
if(browsers.length === 0) browsers.push('_Chrome');

module.exports = func;
17 changes: 11 additions & 6 deletions test/jasmine/tests/lib_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1558,12 +1558,17 @@ describe('Test lib.js:', function() {

describe('cleanNumber', function() {
it('should return finite numbers untouched', function() {
[
0, 1, 2, 1234.567,
-1, -100, -999.999,
Number.MAX_VALUE, Number.MIN_VALUE, Number.EPSILON,
-Number.MAX_VALUE, -Number.MIN_VALUE, -Number.EPSILON
].forEach(function(v) {
var vals = [
0, 1, 2, 1234.567, -1, -100, -999.999,
Number.MAX_VALUE, Number.MIN_VALUE,
-Number.MAX_VALUE, -Number.MIN_VALUE
];

if(!Lib.isIE()) {
vals.push(Number.EPSILON, -Number.EPSILON);
}

vals.forEach(function(v) {
expect(Lib.cleanNumber(v)).toBe(v);
});
});
Expand Down

0 comments on commit 1e1495f

Please sign in to comment.