diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 000000000..31f13de42
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1,253 @@
+module.exports = {
+ settings: {
+ react: {
+ version: 'detect',
+ },
+ },
+ env: {
+ browser: true,
+ es6: true,
+ },
+ extends: [
+ 'plugin:react/recommended',
+ 'prettier',
+ 'prettier/@typescript-eslint',
+ ],
+ parser: '@typescript-eslint/parser',
+ parserOptions: {
+ project: 'tsconfig.json',
+ sourceType: 'module',
+ },
+ plugins: [
+ 'eslint-plugin-import',
+ 'eslint-plugin-react',
+ 'eslint-plugin-prefer-arrow',
+ 'eslint-plugin-jsdoc',
+ '@typescript-eslint',
+ '@typescript-eslint/tslint',
+ ],
+ rules: {
+ '@typescript-eslint/adjacent-overload-signatures': 'error',
+ '@typescript-eslint/array-type': [
+ 'error',
+ {
+ default: 'array-simple',
+ },
+ ],
+ '@typescript-eslint/ban-types': [
+ 'error',
+ {
+ types: {
+ Object: {
+ message:
+ 'Avoid using the `Object` type. Did you mean `object`?',
+ },
+ Function: {
+ message:
+ 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.',
+ },
+ Boolean: {
+ message:
+ 'Avoid using the `Boolean` type. Did you mean `boolean`?',
+ },
+ Number: {
+ message:
+ 'Avoid using the `Number` type. Did you mean `number`?',
+ },
+ String: {
+ message:
+ 'Avoid using the `String` type. Did you mean `string`?',
+ },
+ Symbol: {
+ message:
+ 'Avoid using the `Symbol` type. Did you mean `symbol`?',
+ },
+ },
+ },
+ ],
+ '@typescript-eslint/consistent-type-assertions': 'error',
+ '@typescript-eslint/consistent-type-definitions': 'error',
+ '@typescript-eslint/dot-notation': 'off',
+ '@typescript-eslint/explicit-member-accessibility': [
+ 'error',
+ {
+ accessibility: 'explicit',
+ },
+ ],
+ '@typescript-eslint/member-delimiter-style': [
+ 'off',
+ {
+ multiline: {
+ delimiter: 'none',
+ requireLast: true,
+ },
+ singleline: {
+ delimiter: 'semi',
+ requireLast: false,
+ },
+ },
+ ],
+ '@typescript-eslint/member-ordering': 'error',
+ '@typescript-eslint/naming-convention': [
+ 'error',
+ {
+ selector: 'variable',
+ format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
+ leadingUnderscore: 'allow',
+ },
+ {
+ selector: ['method', 'function'],
+ format: ['camelCase', 'PascalCase'],
+ leadingUnderscore: 'allow',
+ },
+ ],
+ '@typescript-eslint/no-empty-function': 'error',
+ '@typescript-eslint/no-empty-interface': 'error',
+ '@typescript-eslint/no-explicit-any': 'off',
+ '@typescript-eslint/no-misused-new': 'error',
+ '@typescript-eslint/no-namespace': 'error',
+ '@typescript-eslint/no-parameter-properties': 'off',
+ '@typescript-eslint/no-this-alias': 'error',
+ '@typescript-eslint/no-unused-expressions': 'error',
+ '@typescript-eslint/no-use-before-define': 'off',
+ '@typescript-eslint/no-var-requires': 'off',
+ '@typescript-eslint/prefer-for-of': 'error',
+ '@typescript-eslint/prefer-function-type': 'off',
+ '@typescript-eslint/prefer-namespace-keyword': 'error',
+ '@typescript-eslint/semi': ['off', null],
+ '@typescript-eslint/triple-slash-reference': [
+ 'error',
+ {
+ path: 'always',
+ types: 'prefer-import',
+ lib: 'always',
+ },
+ ],
+ '@typescript-eslint/tslint/config': [
+ 'error',
+ {
+ rules: {
+ 'prefer-conditional-expression': true,
+ },
+ },
+ ],
+ '@typescript-eslint/unified-signatures': 'error',
+ // '@typescript-eslint/no-shadow': ['error'],
+ 'arrow-body-style': 'error',
+ 'arrow-parens': ['off', 'always'],
+ 'brace-style': ['off', 'off'],
+ complexity: 'off',
+ 'constructor-super': 'error',
+ curly: 'error',
+ eqeqeq: ['error', 'smart'],
+ 'guard-for-in': 'error',
+ 'id-blacklist': [
+ 'error',
+ 'any',
+ 'Number',
+ 'number',
+ 'String',
+ 'string',
+ 'Boolean',
+ 'boolean',
+ 'Undefined',
+ 'undefined',
+ ],
+ 'id-match': 'error',
+ 'import/no-extraneous-dependencies': [
+ 'error',
+ {
+ devDependencies: false,
+ },
+ ],
+ 'import/no-internal-modules': 'off',
+ 'import/order': 'off',
+ 'jsdoc/check-alignment': 'error',
+ 'jsdoc/check-indentation': 'error',
+ 'jsdoc/newline-after-description': 'error',
+ 'max-classes-per-file': 'off',
+ 'no-bitwise': 'error',
+ 'no-caller': 'error',
+ 'no-cond-assign': 'error',
+ 'no-console': 'off',
+ 'no-debugger': 'error',
+ 'no-duplicate-case': 'error',
+ 'no-duplicate-imports': 'error',
+ 'no-empty': 'error',
+ 'no-eval': 'error',
+ 'no-extra-bind': 'error',
+ 'no-fallthrough': 'off',
+ 'no-invalid-this': 'off',
+ 'no-irregular-whitespace': 'off',
+ 'no-new-func': 'error',
+ 'no-new-wrappers': 'error',
+ 'no-redeclare': 'error',
+ 'no-return-await': 'error',
+ 'no-sequences': 'error',
+ 'no-shadow': 'off',
+ 'no-sparse-arrays': 'error',
+ 'no-template-curly-in-string': 'error',
+ 'no-throw-literal': 'error',
+ 'no-undef-init': 'error',
+ 'no-underscore-dangle': 'off',
+ 'no-unsafe-finally': 'error',
+ 'no-unused-labels': 'error',
+ 'no-var': 'error',
+ 'object-shorthand': 'error',
+ 'one-var': ['error', 'never'],
+ 'prefer-arrow/prefer-arrow-functions': [
+ 'error',
+ { allowStandaloneDeclarations: true },
+ ],
+ 'prefer-const': 'error',
+ 'prefer-object-spread': 'error',
+ radix: 'error',
+ 'react/display-name': 'off',
+ 'react/jsx-boolean-value': 'off',
+ 'react/jsx-curly-spacing': 'off',
+ 'react/jsx-equals-spacing': 'off',
+ 'react/jsx-key': 'error',
+ 'react/jsx-no-bind': [
+ 'error',
+ { allowArrowFunctions: true, allowBind: true },
+ ],
+ 'react/jsx-no-comment-textnodes': 'error',
+ 'react/jsx-no-duplicate-props': 'error',
+ 'react/jsx-no-target-blank': 'error',
+ 'react/jsx-no-undef': 'error',
+ 'react/jsx-uses-react': 'error',
+ 'react/jsx-uses-vars': 'error',
+ 'react/jsx-wrap-multilines': 'off',
+ 'react/no-children-prop': 'error',
+ 'react/no-danger-with-children': 'error',
+ 'react/no-deprecated': 'error',
+ 'react/no-direct-mutation-state': 'error',
+ 'react/no-find-dom-node': 'error',
+ 'react/no-is-mounted': 'error',
+ 'react/no-render-return-value': 'error',
+ 'react/no-string-refs': 'error',
+ 'react/no-unescaped-entities': ['error', { forbid: ['>', '}'] }],
+ 'react/no-unknown-property': 'error',
+ 'react/no-unsafe': 'off',
+ 'react/prop-types': 'off',
+ 'react/react-in-jsx-scope': 'error',
+ 'react/require-render-return': 'error',
+ 'react/self-closing-comp': [
+ 'error',
+ {
+ component: true,
+ html: true,
+ },
+ ],
+ 'space-in-parens': ['off', 'never'],
+ 'spaced-comment': [
+ 'error',
+ 'always',
+ {
+ markers: ['/'],
+ },
+ ],
+ 'use-isnan': 'error',
+ 'valid-typeof': 'off',
+ },
+};
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index c9cf5bc5c..b49c89c52 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -1,43 +1,43 @@
name: Tests
on:
- push:
- branches:
- - master
- pull_request:
+ push:
+ branches:
+ - master
+ pull_request:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
- # This workflow contains a single job called "build"
- lint:
- # The type of runner that the job will run on
- runs-on: ubuntu-latest
+ # This workflow contains a single job called "build"
+ lint:
+ # The type of runner that the job will run on
+ runs-on: ubuntu-latest
- # Steps represent a sequence of tasks that will be executed as part of the job
- steps:
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v2
- with:
- fetch-depth: 1
- - name: Set up Python
- uses: actions/setup-python@v1
- with:
- python-version: 3.7
- - name: Set PY
- run: |
- echo 'PY<> $GITHUB_ENV
- echo "$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV
- echo 'EOF' >> $GITHUB_ENV
- - uses: actions/cache@v1
- with:
- path: ~/.cache/pre-commit
- key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- - uses: pre-commit/action@v1.0.1
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- tests:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- with:
- fetch-depth: 1
- - name: Run docker test
- run: make unit_test
+ # Steps represent a sequence of tasks that will be executed as part of the job
+ steps:
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 1
+ - name: Set up Python
+ uses: actions/setup-python@v1
+ with:
+ python-version: 3.7
+ - name: Set PY
+ run: |
+ echo 'PY<> $GITHUB_ENV
+ echo "$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV
+ echo 'EOF' >> $GITHUB_ENV
+ - uses: actions/cache@v1
+ with:
+ path: ~/.cache/pre-commit
+ key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
+ - uses: pre-commit/action@v1.0.1
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ tests:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 1
+ - name: Run docker test
+ run: make test
diff --git a/Makefile b/Makefile
index 8dbf91ce1..07f97247a 100644
--- a/Makefile
+++ b/Makefile
@@ -55,7 +55,7 @@ remove_running_dev_image:
$(eval RUNNING_CONTAINERS=$(shell sh -c 'docker ps -q --filter name=datahub_devserver'))
docker kill $(RUNNING_CONTAINERS) || true
-unit_test: dev_image
+test: dev_image
docker-compose --file containers/docker-compose.test.yml up --abort-on-container-exit
clean: clean_pyc clean_docker
diff --git a/containers/docker-compose.test.yml b/containers/docker-compose.test.yml
index 8eff0ca79..c47456e8e 100644
--- a/containers/docker-compose.test.yml
+++ b/containers/docker-compose.test.yml
@@ -4,4 +4,4 @@ services:
test:
container_name: datahub_test
image: datahub-dev:latest
- command: './datahub/scripts/run_unit_test'
+ command: './datahub/scripts/run_test'
diff --git a/datahub/scripts/run_unit_test b/datahub/scripts/run_test
similarity index 87%
rename from datahub/scripts/run_unit_test
rename to datahub/scripts/run_test
index 400d3b617..ed263486d 100755
--- a/datahub/scripts/run_unit_test
+++ b/datahub/scripts/run_test
@@ -21,13 +21,19 @@ run_js_unit_test() {
run_ts_validation() {
echo 'Start running ts validation >>>>>>>>>>>>>>>>>>>>>>>>>>>>'
- ./node_modules/.bin/tsc --noEmit
+ npm run tsc-check
+}
+
+run_eslint_validation() {
+ echo 'Start running eslint validation >>>>>>>>>>>>>>>>>>>>>>>>>>>>'
+ npm run lint
}
tests=(
"run_python_unit_test"
"run_ts_validation"
"run_js_unit_test"
+ "run_eslint_validation"
"run_webpack_test"
)
diff --git a/datahub/webapp/__tests__/lib/sql-helper/__snapshots__/sql-lexer.test.ts.snap b/datahub/webapp/__tests__/lib/sql-helper/__snapshots__/sql-lexer.test.ts.snap
index f4abba6e5..02b1a8aab 100644
--- a/datahub/webapp/__tests__/lib/sql-helper/__snapshots__/sql-lexer.test.ts.snap
+++ b/datahub/webapp/__tests__/lib/sql-helper/__snapshots__/sql-lexer.test.ts.snap
@@ -7,42 +7,42 @@ Array [
"end": 10,
"line": 1,
"start": 4,
- "string": "select",
+ "text": "select",
"type": "KEYWORD",
},
Object {
"end": 17,
"line": 1,
"start": 13,
- "string": "from",
+ "text": "from",
"type": "KEYWORD",
},
Object {
"end": 23,
"line": 1,
"start": 18,
- "string": "table",
+ "text": "table",
"type": "KEYWORD",
},
Object {
"end": 29,
"line": 1,
"start": 24,
- "string": "where",
+ "text": "where",
"type": "KEYWORD",
},
Object {
"end": 36,
"line": 1,
"start": 30,
- "string": "fielda",
+ "text": "fielda",
"type": "VARIABLE",
},
Object {
"end": 40,
"line": 1,
"start": 39,
- "string": "5",
+ "text": "5",
"type": "NUMBER",
},
],
@@ -51,35 +51,35 @@ Array [
"end": 10,
"line": 2,
"start": 4,
- "string": "select",
+ "text": "select",
"type": "KEYWORD",
},
Object {
"end": 17,
"line": 2,
"start": 13,
- "string": "from",
+ "text": "from",
"type": "KEYWORD",
},
Object {
"end": 23,
"line": 2,
"start": 18,
- "string": "table",
+ "text": "table",
"type": "KEYWORD",
},
Object {
"end": 29,
"line": 2,
"start": 24,
- "string": "where",
+ "text": "where",
"type": "KEYWORD",
},
Object {
"end": 36,
"line": 2,
"start": 30,
- "string": "fieldb",
+ "text": "fieldb",
"type": "VARIABLE",
},
Object {
@@ -87,63 +87,63 @@ Array [
"end": 40,
"line": 2,
"start": 39,
- "string": "(",
+ "text": "(",
"type": "BRACKET",
},
Object {
"end": 46,
"line": 2,
"start": 40,
- "string": "select",
+ "text": "select",
"type": "KEYWORD",
},
Object {
"end": 53,
"line": 2,
"start": 47,
- "string": "fielda",
+ "text": "fielda",
"type": "VARIABLE",
},
Object {
"end": 58,
"line": 2,
"start": 54,
- "string": "from",
+ "text": "from",
"type": "KEYWORD",
},
Object {
"end": 64,
"line": 2,
"start": 59,
- "string": "table",
+ "text": "table",
"type": "KEYWORD",
},
Object {
"end": 70,
"line": 2,
"start": 65,
- "string": "where",
+ "text": "where",
"type": "KEYWORD",
},
Object {
"end": 77,
"line": 2,
"start": 71,
- "string": "fieldb",
+ "text": "fieldb",
"type": "VARIABLE",
},
Object {
"end": 81,
"line": 2,
"start": 80,
- "string": "5",
+ "text": "5",
"type": "NUMBER",
},
Object {
"end": 82,
"line": 2,
"start": 81,
- "string": ")",
+ "text": ")",
"type": "BRACKET",
},
],
@@ -157,35 +157,35 @@ Array [
"end": 6,
"line": 0,
"start": 0,
- "string": "select",
+ "text": "select",
"type": "KEYWORD",
},
Object {
"end": 13,
"line": 0,
"start": 9,
- "string": "from",
+ "text": "from",
"type": "KEYWORD",
},
Object {
"end": 19,
"line": 0,
"start": 14,
- "string": "table",
+ "text": "table",
"type": "KEYWORD",
},
Object {
"end": 25,
"line": 0,
"start": 20,
- "string": "where",
+ "text": "where",
"type": "KEYWORD",
},
Object {
"end": 33,
"line": 0,
"start": 26,
- "string": "extract",
+ "text": "extract",
"type": "KEYWORD",
},
Object {
@@ -193,42 +193,42 @@ Array [
"end": 34,
"line": 0,
"start": 33,
- "string": "(",
+ "text": "(",
"type": "BRACKET",
},
Object {
"end": 38,
"line": 0,
"start": 34,
- "string": "year",
+ "text": "year",
"type": "KEYWORD",
},
Object {
"end": 43,
"line": 0,
"start": 39,
- "string": "from",
+ "text": "from",
"type": "KEYWORD",
},
Object {
"end": 50,
"line": 0,
"start": 44,
- "string": "fielda",
+ "text": "fielda",
"type": "VARIABLE",
},
Object {
"end": 51,
"line": 0,
"start": 50,
- "string": ")",
+ "text": ")",
"type": "BRACKET",
},
Object {
"end": 55,
"line": 0,
"start": 54,
- "string": "5",
+ "text": "5",
"type": "NUMBER",
},
],
@@ -241,63 +241,63 @@ Array [
"end": 6,
"line": 0,
"start": 0,
- "string": "select",
+ "text": "select",
"type": "KEYWORD",
},
Object {
"end": 8,
"line": 0,
"start": 7,
- "string": "*",
+ "text": "*",
"type": "OPERATOR",
},
Object {
"end": 13,
"line": 0,
"start": 9,
- "string": "from",
+ "text": "from",
"type": "KEYWORD",
},
Object {
"end": 19,
"line": 0,
"start": 14,
- "string": "table",
+ "text": "table",
"type": "KEYWORD",
},
Object {
"end": 25,
"line": 0,
"start": 20,
- "string": "where",
+ "text": "where",
"type": "KEYWORD",
},
Object {
"end": 27,
"line": 0,
"start": 26,
- "string": "a",
+ "text": "a",
"type": "KEYWORD",
},
Object {
"end": 29,
"line": 0,
"start": 28,
- "string": "=",
+ "text": "=",
"type": "OPERATOR",
},
Object {
"end": 31,
"line": 0,
"start": 30,
- "string": "5",
+ "text": "5",
"type": "NUMBER",
},
Object {
"end": 32,
"line": 0,
"start": 31,
- "string": ";",
+ "text": ";",
"type": "SEMI",
},
]
@@ -309,161 +309,161 @@ Array [
"end": 6,
"line": 1,
"start": 0,
- "string": "select",
+ "text": "select",
"type": "KEYWORD",
},
Object {
"end": 6,
"line": 2,
"start": 2,
- "string": "aa.a",
+ "text": "aa.a",
"type": "VARIABLE",
},
Object {
"end": 7,
"line": 2,
"start": 6,
- "string": ",",
+ "text": ",",
"type": "COMMA",
},
Object {
"end": 6,
"line": 3,
"start": 2,
- "string": "aa.b",
+ "text": "aa.b",
"type": "VARIABLE",
},
Object {
"end": 4,
"line": 4,
"start": 0,
- "string": "from",
+ "text": "from",
"type": "KEYWORD",
},
Object {
"end": 9,
"line": 5,
"start": 2,
- "string": "table_a",
+ "text": "table_a",
"type": "VARIABLE",
},
Object {
"end": 12,
"line": 5,
"start": 10,
- "string": "aa",
+ "text": "aa",
"type": "VARIABLE",
},
Object {
"end": 6,
"line": 6,
"start": 2,
- "string": "join",
+ "text": "join",
"type": "KEYWORD",
},
Object {
"end": 14,
"line": 6,
"start": 7,
- "string": "table_b",
+ "text": "table_b",
"type": "VARIABLE",
},
Object {
"end": 17,
"line": 6,
"start": 15,
- "string": "bb",
+ "text": "bb",
"type": "VARIABLE",
},
Object {
"end": 20,
"line": 6,
"start": 18,
- "string": "on",
+ "text": "on",
"type": "KEYWORD",
},
Object {
"end": 25,
"line": 6,
"start": 21,
- "string": "aa.a",
+ "text": "aa.a",
"type": "VARIABLE",
},
Object {
"end": 27,
"line": 6,
"start": 26,
- "string": "=",
+ "text": "=",
"type": "OPERATOR",
},
Object {
"end": 32,
"line": 6,
"start": 28,
- "string": "bb.b",
+ "text": "bb.b",
"type": "VARIABLE",
},
Object {
"end": 5,
"line": 7,
"start": 0,
- "string": "where",
+ "text": "where",
"type": "KEYWORD",
},
Object {
"end": 6,
"line": 8,
"start": 2,
- "string": "aa.b",
+ "text": "aa.b",
"type": "VARIABLE",
},
Object {
"end": 8,
"line": 8,
"start": 7,
- "string": "=",
+ "text": "=",
"type": "OPERATOR",
},
Object {
"end": 10,
"line": 8,
"start": 9,
- "string": "3",
+ "text": "3",
"type": "NUMBER",
},
Object {
"end": 5,
"line": 9,
"start": 0,
- "string": "order",
+ "text": "order",
"type": "KEYWORD",
},
Object {
"end": 8,
"line": 9,
"start": 6,
- "string": "by",
+ "text": "by",
"type": "KEYWORD",
},
Object {
"end": 6,
"line": 10,
"start": 2,
- "string": "bb.b",
+ "text": "bb.b",
"type": "VARIABLE",
},
Object {
"end": 5,
"line": 11,
"start": 0,
- "string": "limit",
+ "text": "limit",
"type": "KEYWORD",
},
Object {
"end": 3,
"line": 12,
"start": 2,
- "string": "5",
+ "text": "5",
"type": "NUMBER",
},
]
diff --git a/datahub/webapp/__tests__/lib/sql-helper/sql-formatter.test.ts b/datahub/webapp/__tests__/lib/sql-helper/sql-formatter.test.ts
index a261dbf2c..8027a6cc0 100644
--- a/datahub/webapp/__tests__/lib/sql-helper/sql-formatter.test.ts
+++ b/datahub/webapp/__tests__/lib/sql-helper/sql-formatter.test.ts
@@ -28,7 +28,7 @@ FROM
);
});
test('formatting with templated hive query case', () => {
- // tslint:disable-next-line
+ // eslint-disable-next-line
expect(format('select * from ${ test };', 'hive')).toBe(
`SELECT
*
diff --git a/datahub/webapp/__tests__/ui/AsyncButton.test.js b/datahub/webapp/__tests__/ui/AsyncButton.test.js
index 914e50415..cfed612ae 100644
--- a/datahub/webapp/__tests__/ui/AsyncButton.test.js
+++ b/datahub/webapp/__tests__/ui/AsyncButton.test.js
@@ -11,17 +11,17 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
null} />
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
it('matches snapshot - disbled', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
null} disabled />
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/Box.test.js b/datahub/webapp/__tests__/ui/Box.test.js
index caf401ab3..a955f8383 100644
--- a/datahub/webapp/__tests__/ui/Box.test.js
+++ b/datahub/webapp/__tests__/ui/Box.test.js
@@ -11,8 +11,8 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(Test);
- let serialized = toJson(wrapper);
+ const wrapper = shallow(Test);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/Button.test.js b/datahub/webapp/__tests__/ui/Button.test.js
index 09307812a..77c00bd97 100644
--- a/datahub/webapp/__tests__/ui/Button.test.js
+++ b/datahub/webapp/__tests__/ui/Button.test.js
@@ -11,47 +11,47 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(
' }} />
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/CopyButton.test.js b/datahub/webapp/__tests__/ui/CopyButton.test.js
index d2bf0a2b5..5ff6d3f3a 100644
--- a/datahub/webapp/__tests__/ui/CopyButton.test.js
+++ b/datahub/webapp/__tests__/ui/CopyButton.test.js
@@ -19,7 +19,7 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
{
title="Test Copy"
/>
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/DAG.test.js b/datahub/webapp/__tests__/ui/DAG.test.js
index 5ce0cded8..6068f5cfb 100644
--- a/datahub/webapp/__tests__/ui/DAG.test.js
+++ b/datahub/webapp/__tests__/ui/DAG.test.js
@@ -10,10 +10,10 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
null} />
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/DataHubLogo.test.js b/datahub/webapp/__tests__/ui/DataHubLogo.test.js
index 6f1161d66..7301cabd7 100644
--- a/datahub/webapp/__tests__/ui/DataHubLogo.test.js
+++ b/datahub/webapp/__tests__/ui/DataHubLogo.test.js
@@ -11,13 +11,13 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow();
- let serialized = toJson(wrapper);
+ const wrapper = shallow();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
it('matches snapshot - size', () => {
- let wrapper = shallow();
- let serialized = toJson(wrapper);
+ const wrapper = shallow();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/DebouncedInput.test.js b/datahub/webapp/__tests__/ui/DebouncedInput.test.js
index de2d9b9dc..60be85991 100644
--- a/datahub/webapp/__tests__/ui/DebouncedInput.test.js
+++ b/datahub/webapp/__tests__/ui/DebouncedInput.test.js
@@ -10,21 +10,21 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
null} />
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
it('matches snapshot - placeholder', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
null}
inputProps={{ placeholder: 'test placeholder' }}
/>
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/DisabledSection.test.js b/datahub/webapp/__tests__/ui/DisabledSection.test.js
index 407be368d..54610c4b8 100644
--- a/datahub/webapp/__tests__/ui/DisabledSection.test.js
+++ b/datahub/webapp/__tests__/ui/DisabledSection.test.js
@@ -15,21 +15,21 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
it('matches snapshot - false', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/Divider.test.js b/datahub/webapp/__tests__/ui/Divider.test.js
index 34b79c095..19c47d84d 100644
--- a/datahub/webapp/__tests__/ui/Divider.test.js
+++ b/datahub/webapp/__tests__/ui/Divider.test.js
@@ -11,8 +11,8 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow();
- let serialized = toJson(wrapper);
+ const wrapper = shallow();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/Dropdown.test.js b/datahub/webapp/__tests__/ui/Dropdown.test.js
index 13a5dc37d..562bc9930 100644
--- a/datahub/webapp/__tests__/ui/Dropdown.test.js
+++ b/datahub/webapp/__tests__/ui/Dropdown.test.js
@@ -11,8 +11,8 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow();
- let serialized = toJson(wrapper);
+ const wrapper = shallow();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/EditableTextField.test.js b/datahub/webapp/__tests__/ui/EditableTextField.test.js
index aaafebd08..fd5a473ce 100644
--- a/datahub/webapp/__tests__/ui/EditableTextField.test.js
+++ b/datahub/webapp/__tests__/ui/EditableTextField.test.js
@@ -10,10 +10,10 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
null} />
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/ErrorPage.test.js b/datahub/webapp/__tests__/ui/ErrorPage.test.js
index 0d82b9db2..6888e6e61 100644
--- a/datahub/webapp/__tests__/ui/ErrorPage.test.js
+++ b/datahub/webapp/__tests__/ui/ErrorPage.test.js
@@ -18,18 +18,18 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow();
- let serialized = toJson(wrapper);
+ const wrapper = shallow();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
it('matches snapshot', () => {
- let wrapper = shallow();
- let serialized = toJson(wrapper);
+ const wrapper = shallow();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
it('matches snapshot', () => {
- let wrapper = shallow();
- let serialized = toJson(wrapper);
+ const wrapper = shallow();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/Form.test.js b/datahub/webapp/__tests__/ui/Form.test.js
index d9696ce94..6a316f187 100644
--- a/datahub/webapp/__tests__/ui/Form.test.js
+++ b/datahub/webapp/__tests__/ui/Form.test.js
@@ -34,13 +34,13 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow();
- let serialized = toJson(wrapper);
+ const wrapper = shallow();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
it('matches snapshot', () => {
- let wrapper = shallow();
- let serialized = toJson(wrapper);
+ const wrapper = shallow();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/FullHeight.test.js b/datahub/webapp/__tests__/ui/FullHeight.test.js
index 4fb568849..2f88939fd 100644
--- a/datahub/webapp/__tests__/ui/FullHeight.test.js
+++ b/datahub/webapp/__tests__/ui/FullHeight.test.js
@@ -11,10 +11,10 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
Test
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/Icon.test.js b/datahub/webapp/__tests__/ui/Icon.test.js
index bbfc3a7b4..da319fa24 100644
--- a/datahub/webapp/__tests__/ui/Icon.test.js
+++ b/datahub/webapp/__tests__/ui/Icon.test.js
@@ -11,8 +11,8 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = mount();
- let serialized = toJson(wrapper);
+ const wrapper = mount();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/IconButton.test.js b/datahub/webapp/__tests__/ui/IconButton.test.js
index 173064072..d082c4952 100644
--- a/datahub/webapp/__tests__/ui/IconButton.test.js
+++ b/datahub/webapp/__tests__/ui/IconButton.test.js
@@ -11,26 +11,26 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow( null} />);
- let serialized = toJson(wrapper);
+ const wrapper = shallow( null} />);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
it('matches snapshot - disbled', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
null} disabled />
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
it('matches snapshot - active', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
null} active />
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
it('matches snapshot - with tooltip', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
null}
@@ -38,25 +38,25 @@ describe('matches enzyme snapshots', () => {
tooltipPos="right"
/>
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
it('matches snapshot - with ping', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
null} ping={true} />
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
it('matches snapshot - with ping message', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
null} ping="1" />
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
it('matches snapshot - mixed', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
null}
@@ -65,7 +65,7 @@ describe('matches enzyme snapshots', () => {
ping="1"
/>
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/InfoButton.test.js b/datahub/webapp/__tests__/ui/InfoButton.test.js
index 979ec6d42..2641f96ed 100644
--- a/datahub/webapp/__tests__/ui/InfoButton.test.js
+++ b/datahub/webapp/__tests__/ui/InfoButton.test.js
@@ -11,8 +11,8 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(Test);
- let serialized = toJson(wrapper);
+ const wrapper = shallow(Test);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/JsonViewer.test.js b/datahub/webapp/__tests__/ui/JsonViewer.test.js
index 968e97c85..6fb1aaf9a 100644
--- a/datahub/webapp/__tests__/ui/JsonViewer.test.js
+++ b/datahub/webapp/__tests__/ui/JsonViewer.test.js
@@ -11,8 +11,8 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow();
- let serialized = toJson(wrapper);
+ const wrapper = shallow();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/KeyboardKey.test.js b/datahub/webapp/__tests__/ui/KeyboardKey.test.js
index 52500b6c6..a056ccfbe 100644
--- a/datahub/webapp/__tests__/ui/KeyboardKey.test.js
+++ b/datahub/webapp/__tests__/ui/KeyboardKey.test.js
@@ -11,8 +11,8 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow();
- let serialized = toJson(wrapper);
+ const wrapper = shallow();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/Level.test.js b/datahub/webapp/__tests__/ui/Level.test.js
index a3776c65c..5444a8ae0 100644
--- a/datahub/webapp/__tests__/ui/Level.test.js
+++ b/datahub/webapp/__tests__/ui/Level.test.js
@@ -15,12 +15,12 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/Link.test.js b/datahub/webapp/__tests__/ui/Link.test.js
index 8aa18422e..fb8056ef7 100644
--- a/datahub/webapp/__tests__/ui/Link.test.js
+++ b/datahub/webapp/__tests__/ui/Link.test.js
@@ -11,8 +11,8 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow();
- let serialized = toJson(wrapper);
+ const wrapper = shallow();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/LinkInput.test.js b/datahub/webapp/__tests__/ui/LinkInput.test.js
index 3a02202b1..605ac66e2 100644
--- a/datahub/webapp/__tests__/ui/LinkInput.test.js
+++ b/datahub/webapp/__tests__/ui/LinkInput.test.js
@@ -10,8 +10,8 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow();
- let serialized = toJson(wrapper);
+ const wrapper = shallow();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/ListMenu.test.js b/datahub/webapp/__tests__/ui/ListMenu.test.js
index 32b16f5c7..f9251fe53 100644
--- a/datahub/webapp/__tests__/ui/ListMenu.test.js
+++ b/datahub/webapp/__tests__/ui/ListMenu.test.js
@@ -13,8 +13,8 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow();
- let serialized = toJson(wrapper);
+ const wrapper = shallow();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/Loader.test.js b/datahub/webapp/__tests__/ui/Loader.test.js
index 2296066cd..635ee3ec1 100644
--- a/datahub/webapp/__tests__/ui/Loader.test.js
+++ b/datahub/webapp/__tests__/ui/Loader.test.js
@@ -11,13 +11,13 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow();
- let serialized = toJson(wrapper);
+ const wrapper = shallow();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
it('matches snapshot', () => {
- let wrapper = shallow(children);
- let serialized = toJson(wrapper);
+ const wrapper = shallow(children);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/Loading.test.js b/datahub/webapp/__tests__/ui/Loading.test.js
index 4a3165e03..57ad0ae18 100644
--- a/datahub/webapp/__tests__/ui/Loading.test.js
+++ b/datahub/webapp/__tests__/ui/Loading.test.js
@@ -11,8 +11,8 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow();
- let serialized = toJson(wrapper);
+ const wrapper = shallow();
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/Menu.test.js b/datahub/webapp/__tests__/ui/Menu.test.js
index 2b58e0eed..31ab88d5e 100644
--- a/datahub/webapp/__tests__/ui/Menu.test.js
+++ b/datahub/webapp/__tests__/ui/Menu.test.js
@@ -25,7 +25,7 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/Message.test.js b/datahub/webapp/__tests__/ui/Message.test.js
index 66e9e949b..85c44293f 100644
--- a/datahub/webapp/__tests__/ui/Message.test.js
+++ b/datahub/webapp/__tests__/ui/Message.test.js
@@ -16,12 +16,12 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(Test);
- let serialized = toJson(wrapper);
+ const wrapper = shallow(Test);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
it('matches snapshot - with options', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
{
Test
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
it('matches snapshot - error', () => {
- let wrapper = shallow(Test);
- let serialized = toJson(wrapper);
+ const wrapper = shallow(Test);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/Overlay.test.js b/datahub/webapp/__tests__/ui/Overlay.test.js
index 5b95abee5..dd82d2e78 100644
--- a/datahub/webapp/__tests__/ui/Overlay.test.js
+++ b/datahub/webapp/__tests__/ui/Overlay.test.js
@@ -10,8 +10,8 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(Test);
- let serialized = toJson(wrapper);
+ const wrapper = shallow(Test);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/Pagination.test.js b/datahub/webapp/__tests__/ui/Pagination.test.js
index a68ccef39..db87c2216 100644
--- a/datahub/webapp/__tests__/ui/Pagination.test.js
+++ b/datahub/webapp/__tests__/ui/Pagination.test.js
@@ -15,12 +15,12 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
null}>
Test
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/Popover.test.js b/datahub/webapp/__tests__/ui/Popover.test.js
index 2184d395f..650e885f5 100644
--- a/datahub/webapp/__tests__/ui/Popover.test.js
+++ b/datahub/webapp/__tests__/ui/Popover.test.js
@@ -10,8 +10,8 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow( null}>Test);
- let serialized = toJson(wrapper);
+ const wrapper = shallow( null}>Test);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/ResizableTextArea.test.js b/datahub/webapp/__tests__/ui/ResizableTextArea.test.js
index bc9f63500..034fcb923 100644
--- a/datahub/webapp/__tests__/ui/ResizableTextArea.test.js
+++ b/datahub/webapp/__tests__/ui/ResizableTextArea.test.js
@@ -11,10 +11,10 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(
+ const wrapper = shallow(
null} />
);
- let serialized = toJson(wrapper);
+ const serialized = toJson(wrapper);
expect(serialized).toMatchSnapshot();
});
});
diff --git a/datahub/webapp/__tests__/ui/Select.test.js b/datahub/webapp/__tests__/ui/Select.test.js
index 98535d5f2..27e5e79e6 100644
--- a/datahub/webapp/__tests__/ui/Select.test.js
+++ b/datahub/webapp/__tests__/ui/Select.test.js
@@ -10,15 +10,15 @@ it('renders without crashing', () => {
describe('matches enzyme snapshots', () => {
it('matches snapshot', () => {
- let wrapper = shallow(