Skip to content

Commit

Permalink
perspective-test package
Browse files Browse the repository at this point in the history
  • Loading branch information
texodus committed Sep 8, 2019
1 parent 2931e25 commit da99e1c
Show file tree
Hide file tree
Showing 49 changed files with 216 additions and 271 deletions.
10 changes: 0 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,5 @@
"fix:json": "prettier --tab-width 4 --write **/package.json",
"fix": "npm-run-all --silent fix:*",
"toggle_puppeteer": "node scripts/toggle_puppeteer.js"
},
"jest": {
"projects": [
"packages/perspective",
"packages/perspective-viewer",
"packages/perspective-viewer-hypergrid",
"packages/perspective-viewer-highcharts",
"packages/perspective-viewer-d3fc"
],
"verbose": true
}
}
22 changes: 22 additions & 0 deletions packages/perspective-test/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
presets: [
[
"@babel/preset-env",
{
targets: {
chrome: "57",
node: "8",
ios: "11",
safari: "11",
edge: "16",
firefox: "52"
},
modules: false,
useBuiltIns: "usage",
corejs: 2
}
]
],
sourceType: "unambiguous",
plugins: ["lodash", ["@babel/plugin-proposal-decorators", {legacy: true}], "transform-custom-element-classes"]
};
17 changes: 17 additions & 0 deletions packages/perspective-test/jest.all.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
roots: [
"packages/perspective/test/js",
"packages/perspective-viewer/test/js",
"packages/perspective-viewer-hypergrid/test/js",
"packages/perspective-viewer-highcharts/test/js",
"packages/perspective-viewer-d3fc/test/js"
],
verbose: true,
testURL: "http://localhost/",
transform: {
".js$": "@finos/perspective-test/src/js/transform.js",
".html$": "html-loader-jest"
},
automock: false,
setupFiles: ["@finos/perspective-test/src/js/beforeEachSpec.js"]
};
12 changes: 12 additions & 0 deletions packages/perspective-test/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
// rootDir: "../",
roots: ["test/js/"],
verbose: true,
testURL: "http://localhost/",
transform: {
".js$": "@finos/perspective-test/src/js/transform.js",
".html$": "html-loader-jest"
},
automock: false,
setupFiles: ["@finos/perspective-test/src/js/beforeEachSpec.js"]
};
28 changes: 28 additions & 0 deletions packages/perspective-test/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "@finos/perspective-test",
"version": "0.3.8",
"description": "Test utility based on perspective",
"private": true,
"main": "src/js/index.js",
"module": "src/js/index.js",
"files": [
"src/**/*"
],
"repository": {
"type": "git",
"url": "https://github.com/finos/perspective/packages/perspective-test"
},
"scripts": {
"prebench": "mkdirp build",
"bench": "node bench/versions.js"
},
"author": "",
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.3.4",
"@finos/perspective": "^0.3.8"
},
"devDependencies": {
"@finos/perspective-webpack-plugin": "^0.3.8"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,13 @@ test.capture = function capture(name, body, {timeout = 60000, viewport = null, w

await body(page);

await page.mouse.move(1000, 1000);

if (wait_for_update) {
await page.waitForSelector("perspective-viewer:not([updating])");
await page.evaluate(async () => {
await new Promise(requestAnimationFrame);
});
}

const screenshot = await page.screenshot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
*/

const config = require("../../babel.config.js");
const config = require("@finos/perspective-test/babel.config");
config.presets[0][1].modules = "auto";

module.exports = require("babel-jest").createTransformer(config);
21 changes: 4 additions & 17 deletions packages/perspective-viewer-d3fc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,11 @@
"build": "npm-run-all --silent build:babel build:webpack:cjs build:webpack:umd",
"test:build": "cpx \"test/html/*\" dist/umd",
"watch": "webpack --color --watch --config src/config/d3fc.watch.config.js",
"test:run": "jest --silent --color 2>&1",
"test:unit": "jest --config=test/js/jest.unit.config.js --color --watch",
"test:run": "jest --rootDir=. --config=../perspective-test/jest.config.js --silent --color 2>&1",
"test": "npm-run-all test:build test:run",
"clean": "rimraf dist",
"clean:screenshots": "rimraf \"screenshots/**/*.@(failed|diff).png\""
},
"jest": {
"roots": [
"test/js"
],
"verbose": true,
"testURL": "http://localhost/",
"automock": false,
"transform": {
".js$": "./test/js/transform.js",
".html$": "html-loader-jest"
},
"setupFiles": [
"./test/js/beforeEachSpec.js"
]
},
"publishConfig": {
"access": "public"
},
Expand All @@ -72,5 +56,8 @@
"d3-svg-legend": "^2.25.6",
"d3fc": "14.0.40",
"gradient-parser": "0.1.5"
},
"devDependencies": {
"@finos/perspective-test": "^0.3.8"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

const path = require("path");

const utils = require("@finos/perspective-viewer/test/js/utils.js");
const utils = require("@finos/perspective-test");
const simple_tests = require("@finos/perspective-viewer/test/js/simple_tests.js");

const {withTemplate} = require("./simple-template");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

const path = require("path");

const utils = require("@finos/perspective-viewer/test/js/utils.js");
const utils = require("@finos/perspective-test");
const simple_tests = require("@finos/perspective-viewer/test/js/simple_tests.js");

const {withTemplate} = require("./simple-template");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

const path = require("path");

const utils = require("@finos/perspective-viewer/test/js/utils.js");
const utils = require("@finos/perspective-test");

const {withTemplate} = require("./simple-template");
withTemplate("candlestick", "d3_candlestick", {template: "shares-template"});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

const path = require("path");

const utils = require("@finos/perspective-viewer/test/js/utils.js");
const utils = require("@finos/perspective-test");
const simple_tests = require("@finos/perspective-viewer/test/js/simple_tests.js");

const {withTemplate} = require("./simple-template");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

const path = require("path");

const utils = require("@finos/perspective-viewer/test/js/utils.js");
const utils = require("@finos/perspective-test");
const simple_tests = require("@finos/perspective-viewer/test/js/simple_tests.js");

const {withTemplate} = require("./simple-template");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

const path = require("path");

const utils = require("@finos/perspective-viewer/test/js/utils.js");
const utils = require("@finos/perspective-test");

const {withTemplate} = require("./simple-template");
withTemplate("ohlc", "d3_ohlc", {template: "shares-template"});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

const path = require("path");

const utils = require("@finos/perspective-viewer/test/js/utils.js");
const utils = require("@finos/perspective-test");
const simple_tests = require("@finos/perspective-viewer/test/js/simple_tests.js");

const {withTemplate} = require("./simple-template");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

const path = require("path");

const utils = require("@finos/perspective-viewer/test/js/utils.js");
const utils = require("@finos/perspective-test");
const simple_tests = require("@finos/perspective-viewer/test/js/simple_tests.js");

const {withTemplate} = require("./simple-template");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

const path = require("path");

const utils = require("@finos/perspective-viewer/test/js/utils.js");
const utils = require("@finos/perspective-test");
const simple_tests = require("@finos/perspective-viewer/test/js/simple_tests.js");

const {withTemplate} = require("./simple-template");
Expand Down
20 changes: 0 additions & 20 deletions packages/perspective-viewer-d3fc/test/js/jest.unit.config.js

This file was deleted.

13 changes: 0 additions & 13 deletions packages/perspective-viewer-d3fc/test/js/transform.js

This file was deleted.

6 changes: 3 additions & 3 deletions packages/perspective-viewer-d3fc/test/results/results.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@
"heatmap.html/sorts by an alpha column.": "0baee7f2e20ce704d75d4fc59cc0a1b0",
"heatmap.html/displays visible columns.": "382f28ea5e7e7f5af24ab6688884ac2b",
"candlestick.html/filter to date range.": "5edaf5770c832422360b1ca8ddde01e8",
"candlestick.html/filter by a single instrument.": "f15786ce7b2e831cdf8af64489a2f840",
"ohlc.html/filter by a single instrument.": "187bbbc9a9265807b9fd517c14082271",
"candlestick.html/filter by a single instrument.": "f988ca6494d7a36bada09928cd1a544e",
"ohlc.html/filter by a single instrument.": "0110fac1f2befac1b97a9d33f0022acf",
"ohlc.html/filter to date range.": "7252edbb00597bed894c89cc7b8301e7",
"sunburst.html/shows a grid without any settings applied.": "e61a53b560304cfbe3a6464218910cb0",
"sunburst.html/pivots by a row.": "099b036c83a9e2b50d1c59507f06ddc4",
Expand All @@ -120,5 +120,5 @@
"sunburst.html/highlights invalid filter.": "e48566c24b1655a202d1d227424f71c5",
"sunburst.html/sorts by an alpha column.": "dca6a09d9b0c4b4a3fd6cdb91fa1eb1a",
"sunburst.html/displays visible columns.": "92769650f8ccaf823d070f3bd12aa73b",
"__GIT_COMMIT__": "7a828e3bd1081b553b02584ac18c6dc5c09e54d9"
"__GIT_COMMIT__": "13d836c9ddaa8374b884e9807f8a433c3fc53a6e"
}
14 changes: 3 additions & 11 deletions packages/perspective-viewer-highcharts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,11 @@
"build": "npm-run-all --silent build:babel build:webpack",
"test:build": "cpx \"test/html/*\" dist/umd",
"watch": "webpack --color --watch --config src/config/umd.config.js",
"test:run": "jest --silent --color 2>&1",
"test:run": "jest --rootDir=. --config=../perspective-test/jest.config.js --silent --color 2>&1",
"test": "npm-run-all test:build test:run",
"clean": "rimraf build && rimraf cjs",
"clean:screenshots": "rimraf \"screenshots/**/*.@(failed|diff).png\""
},
"jest": {
"roots": [
"test/js"
],
"verbose": true,
"testURL": "http://localhost/",
"transform": {},
"automock": false
},
"publishConfig": {
"access": "public"
},
Expand All @@ -68,6 +59,7 @@
"highcharts-more": "^0.1.2"
},
"devDependencies": {
"@finos/perspective-webpack-plugin": "^0.3.8"
"@finos/perspective-webpack-plugin": "^0.3.8",
"@finos/perspective-test": "^0.3.8"
}
}
Loading

0 comments on commit da99e1c

Please sign in to comment.