Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #79 from looker/richard/fix/sankey-tests
Browse files Browse the repository at this point in the history
Fix linting tests broken in /pull/77 and pull/68
  • Loading branch information
RichardCzechowski authored Mar 5, 2019
2 parents 47d5f61 + 6ea5bc7 commit a2e9453
Show file tree
Hide file tree
Showing 17 changed files with 2,997 additions and 773 deletions.
5 changes: 4 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"presets": ["es2015", "react"]
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}
10 changes: 9 additions & 1 deletion dist/advanced_table.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/chord.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/collapsible_tree.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/hello_world.js

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

26 changes: 13 additions & 13 deletions dist/hello_world_react.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dist/liquid_fill_gauge.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/sankey.js

Large diffs are not rendered by default.

37 changes: 25 additions & 12 deletions dist/subtotal.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/sunburst.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/treemap.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/v1_common.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"watch": "webpack --config webpack.config.js --watch --progress",
"lint": "tslint --project tsconfig.json --format stylish 'src/**/*.ts'",
"lint-fix": "tslint --fix --project tsconfig.json --format stylish 'src/**/*.ts'",
"test": "mocha"
"test": "jest"
},
"author": "",
"private": true,
Expand All @@ -23,27 +23,27 @@
"d3": "^4.8.0",
"jquery": "^3.3.1",
"jsdom": "^11.11.0",
"mocha": "^3.2.0",
"pivottable": "^2.20.0",
"subtotal-multiple-aggregates": "4mile/subtotal-multiple-aggregates",
"to-string-loader": "^1.1.5",
"ts-loader": "3.2.0",
"tslint": "5.8.0",
"tslint-config-standard": "7.0.0",
"typescript": "2.6.2",
"uglifyjs-webpack-plugin": "^1.2.5",
"webpack": "3.10.0",
"webpack-dev-server": "2.9.7"
},
"dependencies": {
"@babel/core": "^7.3.4",
"@babel/preset-env": "^7.3.4",
"@babel/preset-react": "^7.0.0",
"@types/d3": "^5.0.0",
"@types/d3-sankey": "^0.7.4",
"babel-core": "^6.26.3",
"babel-loader": "7.1.5",
"babel-preset-es2015": "6.24.1",
"babel-preset-react": "6.24.1",
"babel-loader": "^8.0.5",
"d3-sankey": "^0.10.4",
"react": "^16.7.0",
"react-dom": "^16.7.0"
"jest": "^24.1.0",
"react": "^16.8.3",
"react-dom": "^16.7.0",
"typescript": "^3.3.3333"
}
}
4 changes: 2 additions & 2 deletions src/examples/sankey/sankey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ const vis: Sankey = {
data.forEach(function (d: any) {
// variable number of dimensions
const path: any[] = []
for(const dim of dimensions) {
if(d[dim.name].value === null && !config.show_null_points) break
for (const dim of dimensions) {
if (d[dim.name].value === null && !config.show_null_points) break
path.push(d[dim.name].value + '')
}
path.forEach(function (p: any, i: number) {
Expand Down
2 changes: 1 addition & 1 deletion src/examples/sunburst/sunburst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function burrow(table: Row[], config: VisConfig) {

// create children as nested objects
row.taxonomy.value.forEach((key: any) => {
if(key === null && !config.show_null_points) {
if (key === null && !config.show_null_points) {
return
}
layer[key] = key in layer ? layer[key] : {}
Expand Down
10 changes: 5 additions & 5 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@ glob.sync("./dist/*.js").forEach((file) => {
looker.plugins.visualizations.all().forEach((vis) => {
describe(`${vis.label} (as ${vis.id})`, () => {

it("should load and not use unavailable things", () => {
test("should load and not use unavailable things", () => {
// TODO what do we need to assert here
assert(true)
});

it("should have a valid ID", () => {
test("should have a valid ID", () => {
assert(/^\w+$/.test(vis.id))
})

it("should have a label", () => {
test("should have a label", () => {
assert(/\S/.test(vis.label))
})

it("should implement create", () => {
test("should implement create", () => {
assert(typeof vis.create === "function")
})

it("should implement update or updateAsync", () => {
test("should implement update or updateAsync", () => {
assert(typeof vis.update === "function" || typeof vis.updateAsync === "function")
})

Expand Down
Loading

0 comments on commit a2e9453

Please sign in to comment.