Stop bundling specs for improved coverage (#7709)

This commit is contained in:
Jukka Kurkela 2020-08-14 16:15:18 +03:00 committed by GitHub
parent 8fd7ef2901
commit 6ad17c0294
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 2868 additions and 720 deletions

View File

@ -3,7 +3,6 @@
const commonjs = require('@rollup/plugin-commonjs');
const json = require('@rollup/plugin-json');
const resolve = require('@rollup/plugin-node-resolve').default;
const webWorkerLoader = require('rollup-plugin-web-worker-loader');
const builds = require('./rollup.config');
const yargs = require('yargs');
@ -65,13 +64,13 @@ module.exports = function(karma) {
{pattern: 'test/fixtures/**/*.png', included: false},
'node_modules/moment/min/moment.min.js',
{pattern: 'test/index.js', watched: false},
{pattern: 'test/BasicChartWebWorker.js', included: false},
{pattern: 'src/index.js', watched: false},
'node_modules/chartjs-adapter-moment/dist/chartjs-adapter-moment.js',
{pattern: specPattern, watched: false}
],
preprocessors: {
[specPattern]: ['rollup'],
'test/index.js': ['rollup'],
'src/index.js': ['sources']
},
@ -81,7 +80,6 @@ module.exports = function(karma) {
json(),
resolve(),
commonjs({exclude: ['src/**', 'test/**']}),
webWorkerLoader()
],
output: {
name: 'test',

3512
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -33,57 +33,56 @@
"scripts": {
"autobuild": "rollup -c -w",
"build": "rollup -c",
"dev": "karma start ---auto-watch --no-single-run --browsers chrome --grep",
"dev": "karma start --auto-watch --no-single-run --browsers chrome --grep",
"docs": "cd docs && npm install && npm run build",
"lint-js": "eslint samples/**/*.html samples/**/*.js src/**/*.js test/**/*.js",
"lint-tsc": "tsc",
"lint": "concurrently \"npm:lint-*\"",
"test": "npm run lint && cross-env NODE_ENV=test karma start --no-auto-watch --single-run --coverage --grep",
"test": "npm run lint && cross-env NODE_ENV=test karma start --auto-watch --single-run --coverage --grep",
"typedoc": "npx typedoc"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"@babel/plugin-transform-object-assign": "^7.8.3",
"@babel/preset-env": "^7.10.2",
"@babel/core": "^7.11.1",
"@babel/plugin-transform-object-assign": "^7.10.4",
"@babel/preset-env": "^7.11.0",
"@kurkle/color": "^0.1.9",
"@rollup/plugin-commonjs": "^13.0.0",
"@rollup/plugin-commonjs": "^15.0.0",
"@rollup/plugin-inject": "^4.0.2",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^8.0.1",
"@rollup/plugin-node-resolve": "^9.0.0",
"babel-plugin-istanbul": "^6.0.0",
"babel-preset-es2015-rollup": "^3.0.0",
"chartjs-adapter-moment": "^0.1.1",
"concurrently": "^5.2.0",
"chartjs-adapter-moment": "^0.1.2",
"concurrently": "^5.3.0",
"coveralls": "^3.1.0",
"cross-env": "^7.0.2",
"eslint": "^7.2.0",
"eslint": "^7.6.0",
"eslint-config-chartjs": "^0.2.0",
"eslint-config-esnext": "^4.1.0",
"eslint-plugin-html": "^6.0.2",
"eslint-plugin-html": "^6.0.3",
"glob": "^7.1.6",
"jasmine": "^3.5.0",
"jasmine-core": "^3.5.0",
"karma": "^5.0.9",
"jasmine": "^3.6.1",
"jasmine-core": "^3.6.0",
"karma": "^5.1.1",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^2.0.2",
"karma-coverage": "^2.0.3",
"karma-edge-launcher": "^0.4.2",
"karma-firefox-launcher": "^1.3.0",
"karma-jasmine": "^3.3.1",
"karma-jasmine": "^4.0.1",
"karma-jasmine-html-reporter": "^1.5.4",
"karma-rollup-preprocessor": "^7.0.5",
"karma-safari-private-launcher": "^1.0.0",
"moment": "^2.26.0",
"pixelmatch": "^5.2.0",
"moment": "^2.27.0",
"pixelmatch": "^5.2.1",
"resize-observer-polyfill": "^1.5.1",
"rollup": "^2.15.0",
"rollup": "^2.25.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-cleanup": "^3.1.1",
"rollup-plugin-dts": "^1.4.9",
"rollup-plugin-terser": "^6.1.0",
"rollup-plugin-web-worker-loader": "^1.3.0",
"typedoc": "^0.17.7",
"typescript": "^3.9.5",
"yargs": "^15.3.1"
"rollup-plugin-dts": "^1.4.10",
"rollup-plugin-terser": "^7.0.0",
"typedoc": "^0.18.0",
"typescript": "^3.9.7",
"yargs": "^15.4.1"
},
"dependencies": {}
}

View File

@ -6,6 +6,7 @@ import * as collection from './helpers.collection';
import * as curve from './helpers.curve';
import * as dom from './helpers.dom';
import effects from './helpers.easing';
import * as interpolation from './helpers.interpolation';
import * as options from './helpers.options';
import * as math from './helpers.math';
import * as rtl from './helpers.rtl';
@ -20,6 +21,7 @@ export default {
curve,
dom,
easing: {effects},
interpolation,
options,
math,
rtl,

View File

@ -5,7 +5,8 @@
// Receives messages with data of type: { type: 'initialize', canvas: OffscreenCanvas }
// Sends messages with data of types: { type: 'success' } | { type: 'error', errorMessage: string }
import Chart from '../src';
// eslint-disable-next-line no-undef
importScripts('../src/chart.js');
onmessage = function(event) {
try {

View File

@ -1,5 +1,3 @@
'use strict';
import fixture from './fixture';
import Context from './context';
import matchers from './matchers';

View File

@ -1,4 +1,4 @@
import {_filterBetween, _lookup, _lookupByKey, _rlookupByKey} from '../../src/helpers/helpers.collection';
const {_filterBetween, _lookup, _lookupByKey, _rlookupByKey} = Chart.helpers.collection;
describe('helpers.collection', function() {
it('Should do binary search', function() {

View File

@ -1,4 +1,4 @@
import {color, getHoverColor} from '../../src/helpers/helpers.color';
const {color, getHoverColor} = Chart.helpers;
describe('Color helper', function() {
function isColorInstance(obj) {

View File

@ -1,4 +1,4 @@
import {_pointInLine, _steppedInterpolation, _bezierInterpolation} from '../../src/helpers/helpers.interpolation';
const {_pointInLine, _steppedInterpolation, _bezierInterpolation} = Chart.helpers.interpolation;
describe('helpers.interpolation', function() {
it('Should interpolate a point in line', function() {

View File

@ -1,6 +1,4 @@
'use strict';
import * as math from '../../src/helpers/helpers.math';
const math = Chart.helpers.math;
describe('Chart.helpers.math', function() {
var factorize = math._factorize;

View File

@ -1,5 +1,3 @@
import BasicChartWebWorker from 'web-worker:../BasicChartWebWorker'; // eslint-disable-line import/no-unresolved
describe('Platform.basic', function() {
it('should automatically choose the BasicPlatform for offscreen canvas', function() {
@ -17,7 +15,7 @@ describe('Platform.basic', function() {
}
const offscreenCanvas = canvas.transferControlToOffscreen();
const worker = new BasicChartWebWorker();
const worker = new Worker('base/test/BasicChartWebWorker.js');
worker.onmessage = (event) => {
worker.terminate();
const {type, errorMessage} = event.data;

View File

@ -1,4 +1,4 @@
import {DomPlatform} from '../../src/platform';
const DomPlatform = Chart.platforms.DomPlatform;
describe('Platform.dom', function() {