Browse Source

Use chrome in testing (#2083)

* chore: switch to chrome testing

* test: relax pixel assertions to pass in chrome

* chore: add codecov.yml
pull/2090/head
Yoshiya Hinosawa 7 years ago committed by GitHub
parent
commit
c343243ef1
  1. 12
      .travis.yml
  2. 9
      circle.yml
  3. 7
      codecov.yml
  4. 2
      karma.conf.js
  5. 4057
      package-lock.json
  6. 3
      package.json
  7. 2
      spec/axis-spec.js
  8. 6
      spec/data-spec.js

12
.travis.yml

@ -1,7 +1,17 @@
sudo: false
language: node_js
node_js:
- 6
dist: trusty
sudo: false
addons:
apt:
packages:
- google-chrome-stable
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start &
- sleep 3
after_success:
- npm run codecov

9
circle.yml

@ -0,0 +1,9 @@
machine:
node:
verison: 6
dependencies:
pre:
- curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome.deb
- sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome
- rm google-chrome.deb

7
codecov.yml

@ -0,0 +1,7 @@
coverage:
status:
project:
default:
threshold: 0.4
patch: no
change: no

2
karma.conf.js

@ -20,7 +20,7 @@ module.exports = function(config) {
reports: ['html', 'lcovonly', 'text-summary']
},
autoWatch: true,
browsers: ['PhantomJS'],
browsers: ['Chrome'],
singleRun: true,
browserNoActivityTimeout: 120000,
})

4057
package-lock.json generated

File diff suppressed because it is too large Load Diff

3
package.json

@ -50,13 +50,12 @@
"jshint-stylish": "^2.1.0",
"karma": "^1.7.0",
"karma-browserify": "^5.1.1",
"karma-chrome-launcher": "^2.1.1",
"karma-coverage-istanbul-reporter": "^1.3.0",
"karma-jasmine": "^1.1.0",
"karma-phantomjs-launcher": "^1.0.4",
"karma-spec-reporter": "0.0.31",
"node-sass": "^4.5.3",
"node-static": "^0.7.9",
"phantomjs": "^2.1.7",
"rollup": "^0.41.6",
"uglify-js": "^3.0.15",
"watchify": "^3.9.0"

2
spec/axis-spec.js

@ -587,7 +587,7 @@ describe('c3 chart axis', function () {
var box = chart.internal.main.select('.c3-axis-x').node().getBoundingClientRect(),
height = chart.internal.getHorizontalAxisHeight('x');
expect(box.height).toBeGreaterThan(50);
expect(height).toBeCloseTo(76, -1); // @TODO make this test better
expect(height).toBeCloseTo(76, -1.3); // @TODO make this test better
});
});

6
spec/data-spec.js

@ -1211,7 +1211,7 @@ describe('c3 chart data', function () {
it('should have y domain with proper padding', function () {
var domain = chart.internal.y.domain();
expect(domain[0]).toBeCloseTo(0, -1);
expect(domain[1]).toBeCloseTo(888, -1);
expect(domain[1]).toBeCloseTo(888, -1.2);
});
it('should locate labels above each data point', function () {
@ -1234,7 +1234,7 @@ describe('c3 chart data', function () {
it('should have y domain with proper padding', function () {
var domain = chart.internal.y.domain();
expect(domain[0]).toBeCloseTo(-87, -1);
expect(domain[1]).toBeCloseTo(887, -1);
expect(domain[1]).toBeCloseTo(887, -1.2);
});
it('should locate labels above each data point', function () {
@ -1350,7 +1350,7 @@ describe('c3 chart data', function () {
it('should have y domain with proper padding', function () {
var domain = chart.internal.y.domain();
expect(domain[0]).toBeCloseTo(-899, -1);
expect(domain[1]).toBeCloseTo(101, -1);
expect(domain[1]).toBeCloseTo(101, -1.2);
});
it('should locate labels above each data point', function () {

Loading…
Cancel
Save