diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 2f456f0d..01b81b92 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -1,13 +1,8 @@
-const {getESLintConfig} = require('ocular-dev-tools/configuration');
+const {getESLintConfig} = require('@vis.gl/dev-tools/configuration');
module.exports = getESLintConfig({
react: '16.8.2',
overrides: {
- parser: '',
- parserOptions: {
- project: ['./tsconfig.json']
- },
-
env: {
browser: true,
es2020: true,
@@ -15,26 +10,23 @@ module.exports = getESLintConfig({
},
rules: {
- 'import/no-unresolved': 1,
- 'no-console': 1,
+ 'no-console': 'warn',
'no-continue': ['warn'],
- 'callback-return': 0,
- 'accessor-pairs': 0,
'max-depth': ['warn', 4],
camelcase: 'off',
- complexity: 'off',
- 'max-statements': 'off',
- 'default-case': ['warn'],
- 'no-eq-null': ['warn'],
- eqeqeq: ['warn'],
- radix: 0
- // 'accessor-pairs': ['error', {getWithoutSet: false, setWithoutGet: false}]
+ complexity: 'warn',
+ 'max-statements': 'warn'
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx', '**/*.d.ts'],
rules: {
+
+ 'no-shadow': 'off',
+ '@typescript-eslint/no-shadow': 'error',
+ 'no-use-before-define': 'off',
+
'@typescript-eslint/no-floating-promises': 0,
// Gradually enable
'@typescript-eslint/ban-ts-comment': 0,
@@ -42,43 +34,20 @@ module.exports = getESLintConfig({
'@typescript-eslint/no-unsafe-member-access': 0,
'@typescript-eslint/no-unsafe-assignment': 0,
'@typescript-eslint/no-var-requires': 0,
- '@typescript-eslint/no-unused-vars': [
- 'warn',
- {vars: 'all', args: 'none', ignoreRestSiblings: false}
- ],
- // We still have some issues with import resolution
- 'import/named': 0,
- 'import/no-extraneous-dependencies': ['error', {devDependencies: true}], // Warn instead of error
- // 'max-params': ['warn'],
- // 'no-undef': ['warn'],
- // camelcase: ['warn'],
- // '@typescript-eslint/no-floating-promises': ['warn'],
- // '@typescript-eslint/await-thenable': ['warn'],
- // '@typescript-eslint/no-misused-promises': ['warn'],
'@typescript-eslint/no-empty-function': ['warn', {allow: ['arrowFunctions']}],
- // We use function hoisting
- '@typescript-eslint/no-use-before-define': 0,
// We always want explicit typing, e.g `field: string = ''`
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/restrict-template-expressions': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/require-await': 0,
+ '@typescript-eslint/no-explicit-any': 0,
+ '@typescript-eslint/no-unsafe-argument': 0,
'@typescript-eslint/no-unsafe-return': 0,
'@typescript-eslint/no-unsafe-call': 0,
'@typescript-eslint/no-empty-interface': 0,
'@typescript-eslint/restrict-plus-operands': 0
}
},
- {
- // scripts use devDependencies
- files: ['*worker*.js', '**/worker-utils/**/*.js'],
- env: {
- browser: true,
- es2020: true,
- node: true,
- worker: true
- }
- },
// tests are run with aliases set up in node and webpack.
// This means lint will not find the imported files and generate false warnings
{
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index af128524..9607dc5b 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -4,39 +4,35 @@ name: test
on:
push:
branches:
- - master
+ - master
pull_request:
jobs:
test:
runs-on: ubuntu-latest
- strategy:
- matrix:
- node-version: [18, 20]
steps:
- - uses: actions/checkout@v2.1.1
-
- - name: Set up Node ${{ matrix.node-version }}
- uses: actions/setup-node@v1
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+ - uses: volta-cli/action@2d68418f32546fd191eb666e232b321d5726484d # v4.1.1
with:
- node-version: ${{ matrix.node-version }}
-
- - name: Bootstrap
+ cache: 'yarn'
+
+ - name: Install dependencies
run: |
- npm run bootstrap
+ yarn install
+ env:
+ YARN_ENABLE_IMMUTABLE_INSTALLS: false
- - name: Run build
+ - name: Build code
run: |
- npm run build
+ yarn build
- name: Run tests
run: |
- npm run test ci
+ yarn lint
+ yarn test ci
- name: Coveralls
- if: matrix.node-version == 16
- uses: coverallsapp/github-action@master
+ uses: coverallsapp/github-action@09b709cf6a16e30b0808ba050c7a6e8a5ef13f8d # v1.2.5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- path-to-lcov: ${{ github.workspace }}/coverage/lcov.info
diff --git a/.ocularrc.js b/.ocularrc.js
index 065b13dd..ca836225 100644
--- a/.ocularrc.js
+++ b/.ocularrc.js
@@ -1,18 +1,12 @@
/* @type import('ocular-dev-tools').OcularConfig */
export default {
- babel: false,
-
- typescript: {
- project: 'tsconfig.build.json'
- },
-
lint: {
paths: ['modules', 'examples', 'test']
},
entry: {
test: 'test/node.js',
- 'test-browser': 'test/browser.js',
+ 'test-browser': 'test/index.html',
bench: 'test/bench/index.ts',
'bench-browser': 'test/bench/browser.ts',
size: ['test/size/log.js', 'test/size/stat.js']
diff --git a/.prettierrc b/.prettierrc
deleted file mode 100644
index 4b20886b..00000000
--- a/.prettierrc
+++ /dev/null
@@ -1,6 +0,0 @@
-printWidth: 100
-semi: true
-singleQuote: true
-trailingComma: none
-bracketSpacing: false
-arrowParens: avoid
diff --git a/aliases.js b/aliases.js
deleted file mode 100644
index 990a98c2..00000000
--- a/aliases.js
+++ /dev/null
@@ -1,16 +0,0 @@
-// Enables ES2015 import/export in Node.js
-const path = require('path');
-
-const ALIASES = {
- // Main lib
- 'probe.gl/env': path.resolve(__dirname, './modules/main/env'),
- 'probe.gl': path.resolve(__dirname, './modules/main/src'),
- '@probe.gl/bench': path.resolve(__dirname, './modules/bench/src'),
- '@probe.gl/env': path.resolve(__dirname, './modules/env/src'),
- '@probe.gl/log': path.resolve(__dirname, './modules/log/src'),
- '@probe.gl/react-bench': path.resolve(__dirname, './modules/react-bench/src'),
- '@probe.gl/test-utils': path.resolve(__dirname, './modules/test-utils/src'),
- '@probe.gl/stats-widget': path.resolve(__dirname, './modules/stats-widget/src')
-};
-
-module.exports = ALIASES;
diff --git a/examples/browser-test-vite/test/index.js b/examples/browser-test-vite/test/index.js
index 5c349b8f..4d1abcda 100644
--- a/examples/browser-test-vite/test/index.js
+++ b/examples/browser-test-vite/test/index.js
@@ -5,7 +5,7 @@ import {render} from './app.js';
test.onFailure(window.browserTestDriver_fail);
test.onFinish(window.browserTestDriver_finish);
-test('A test', t => {
+test('A test', (t) => {
// Default tape test timeout is 500ms - allow enough time for render and screenshot
t.timeoutAfter(2000);
@@ -18,7 +18,7 @@ test('A test', t => {
region: app.getBoundingClientRect(),
saveOnFail: true
})
- .then(result => {
+ .then((result) => {
if (result.error) {
t.fail(String(result.error));
} else {
diff --git a/examples/browser-test-webpack/test/index.js b/examples/browser-test-webpack/test/index.js
index 5c349b8f..4d1abcda 100644
--- a/examples/browser-test-webpack/test/index.js
+++ b/examples/browser-test-webpack/test/index.js
@@ -5,7 +5,7 @@ import {render} from './app.js';
test.onFailure(window.browserTestDriver_fail);
test.onFinish(window.browserTestDriver_finish);
-test('A test', t => {
+test('A test', (t) => {
// Default tape test timeout is 500ms - allow enough time for render and screenshot
t.timeoutAfter(2000);
@@ -18,7 +18,7 @@ test('A test', t => {
region: app.getBoundingClientRect(),
saveOnFail: true
})
- .then(result => {
+ .then((result) => {
if (result.error) {
t.fail(String(result.error));
} else {
diff --git a/examples/stats-widget/app.tsx b/examples/stats-widget/app.tsx
index 68e04618..ef8422af 100644
--- a/examples/stats-widget/app.tsx
+++ b/examples/stats-widget/app.tsx
@@ -61,7 +61,7 @@ export default class App extends Component {
}
override render() {
- return
(this._container = _)} />;
+ return
(this._container = _)} />;
}
}
diff --git a/examples/webpack.config.local.js b/examples/webpack.config.local.js
index 1d8fc648..a68e84a7 100644
--- a/examples/webpack.config.local.js
+++ b/examples/webpack.config.local.js
@@ -54,7 +54,7 @@ function addLocalDevSettings(config, opts) {
module.exports =
(baseConfig, opts = {}) =>
- env => {
+ (env) => {
let config = baseConfig;
if (env && env.local) {
diff --git a/lerna-debug.log b/lerna-debug.log
deleted file mode 100644
index 889f1689..00000000
--- a/lerna-debug.log
+++ /dev/null
@@ -1,5 +0,0 @@
-42 error Error: Command failed: git tag v3.1.0-alpha.8 -m v3.1.0-alpha.8
-42 error fatal: tag 'v3.1.0-alpha.8' already exists
-42 error
-42 error at makeError (/Users/xintongxia/dev/probe.gl/node_modules/execa/index.js:174:9)
-42 error at Promise.all.then.arr (/Users/xintongxia/dev/probe.gl/node_modules/execa/index.js:278:16)
diff --git a/lerna.json b/lerna.json
index 3710acf1..731928d5 100644
--- a/lerna.json
+++ b/lerna.json
@@ -2,8 +2,7 @@
"lerna": "2.9.1",
"version": "4.0.9",
"packages": [
- "modules/*",
- "examples/*"
+ "modules/*"
],
"npmClient": "yarn",
"useWorkspaces": true
diff --git a/modules/bench/src/bench.ts b/modules/bench/src/bench.ts
index ffda18e7..257b0bc1 100644
--- a/modules/bench/src/bench.ts
+++ b/modules/bench/src/bench.ts
@@ -30,7 +30,7 @@ export type BenchProps = {
minIterations?: number;
};
-export type BenchTestFunction = (testArgs?: unknown) => unknown | Promise
;
+export type BenchTestFunction = (testArgs?: T) => T | Promise;
export type BenchInitFunction = () => unknown;
/** Options for a specific test case */
@@ -162,6 +162,7 @@ export class Bench {
}
/** Not yet implemented */
+ // eslint-disable-next-line
calibrate(id?: string, func1?: Function, func2?: Function, props?: {}): this {
return this;
}
@@ -276,7 +277,7 @@ export class Bench {
// Helper function to promisify setTimeout
function addDelay(timeout: number): Promise {
- return new Promise(resolve => {
+ return new Promise((resolve) => {
setTimeout(() => resolve(), timeout);
});
}
@@ -290,14 +291,10 @@ function runCalibrationTests({testCases}: {testCases: Record {
+test('Bench#import', (t) => {
t.equals(typeof Bench, 'function', 'Expected row logged');
t.end();
});
-test('Bench#constructor', t => {
+test('Bench#constructor', (t) => {
const suite = new Bench({id: 'test'});
t.ok(suite instanceof Bench, 'suite created successfully');
t.end();
});
-test('Bench#run', t => {
+test('Bench#run', (t) => {
const suite = new Bench({
id: 'test',
log: ({message}) => t.comment(message)
});
- suite.add('initFunc in options', {initialize: () => 1, unit: 'initializations'}, value => {
+ suite.add('initFunc in options', {initialize: () => 1, unit: 'initializations'}, (value) => {
// @ts-expect-error
if (!value === 1) {
t.fail();
diff --git a/modules/bench/test/format-utils.spec.ts b/modules/bench/test/format-utils.spec.ts
index 05b4864b..5c66dcf8 100644
--- a/modules/bench/test/format-utils.spec.ts
+++ b/modules/bench/test/format-utils.spec.ts
@@ -11,7 +11,7 @@ const FORMAT_SI_TESTS = [
{value: 0.0001234, result: '123ยต'}
];
-test('formatters#formatSI', t => {
+test('formatters#formatSI', (t) => {
for (const tc of FORMAT_SI_TESTS) {
const result = formatSI(tc.value);
t.equal(result, tc.result, `formatSI(${tc.value}) should be ${tc.result}`);
diff --git a/modules/bench/test/parse-color.bench.ts b/modules/bench/test/parse-color.bench.ts
index ffc7176f..4f6bfc14 100644
--- a/modules/bench/test/parse-color.bench.ts
+++ b/modules/bench/test/parse-color.bench.ts
@@ -16,48 +16,50 @@ export default function benchColor(suite: Bench): Bench {
.add(
'color#parseColor (3 element array) -> Uint8ClampedArray target',
{initialize: () => new Uint8ClampedArray(4)},
- target => parseColor(COLOR_ARRAY_4, target)
+ (target) => parseColor(COLOR_ARRAY_4, target)
)
.add(
'color#parseColor (3 element typed array) -> Uint8ClampedArray target',
{priority: 1, initialize: () => new Uint8ClampedArray(4)},
- target => parseColor(COLOR_TYPED_ARRAY, target)
+ (target) => parseColor(COLOR_TYPED_ARRAY, target)
)
.add(
'color#parseColor (4 element typed array) -> Uint8ClampedArray target',
{priority: 1, initialize: () => new Uint8ClampedArray(4)},
- target => parseColor(COLOR_TYPED_ARRAY_4, target)
+ (target) => parseColor(COLOR_TYPED_ARRAY_4, target)
)
.add(
'color#parseColor (3 element array) -> array target',
{priority: 1, initialize: () => []},
- target => parseColor(COLOR_ARRAY, target)
+ (target) => parseColor(COLOR_ARRAY, target)
)
.add(
'color#parseColor (4 element array) -> array target',
{priority: 1, initialize: () => []},
- target => parseColor(COLOR_ARRAY_4, target)
+ (target) => parseColor(COLOR_ARRAY_4, target)
)
.group('Parse Color: From string')
.add(
'color#parseColor (string) -> typed array target',
{initialize: () => new Uint8ClampedArray(4)},
- target => parseColor(COLOR_STRING, target)
+ (target) => parseColor(COLOR_STRING, target)
)
.add(
'color#parseColor (string with alpha) -> typed array target',
{priority: 1, initialize: () => new Uint8ClampedArray(4)},
- target => parseColor(COLOR_STRING_4, target)
+ (target) => parseColor(COLOR_STRING_4, target)
)
- .add('color#parseColor (string) -> array target', {priority: 1, initialize: () => []}, target =>
- parseColor(COLOR_STRING, target)
+ .add(
+ 'color#parseColor (string) -> array target',
+ {priority: 1, initialize: () => []},
+ (target) => parseColor(COLOR_STRING, target)
)
.add(
'color#parseColor (string with alpha) -> array target',
{priority: 1, initialize: () => []},
- target => parseColor(COLOR_STRING_4, target)
+ (target) => parseColor(COLOR_STRING_4, target)
)
.add('color#parseColor (string), no target', {priority: 1}, () => parseColor(COLOR_STRING))
diff --git a/modules/bench/test/stat-utils.spec.ts b/modules/bench/test/stat-utils.spec.ts
index c69ad3e9..b805e720 100644
--- a/modules/bench/test/stat-utils.spec.ts
+++ b/modules/bench/test/stat-utils.spec.ts
@@ -3,7 +3,7 @@ import test from 'tape-promise/tape';
import {mean, std, cv} from '@probe.gl/bench/stat-utils';
// wolfram alpha: mean {1, 2, 3}
-test('statistics#mean', t => {
+test('statistics#mean', (t) => {
const MEAN_TESTS = [
{
input: [1],
@@ -26,7 +26,7 @@ test('statistics#mean', t => {
});
// wolfram alpha: standard deviation {1, 2, 3}
-test('statistics#std', t => {
+test('statistics#std', (t) => {
const STD_TESTS = [
{
input: [1],
@@ -53,7 +53,7 @@ test('statistics#std', t => {
});
// wolfram alpha: coefficient of variation {1, 2, 3}
-test('statistics#cv', t => {
+test('statistics#cv', (t) => {
const STD_ERR_TESTS = [
{
input: [1],
diff --git a/modules/bench/tsconfig.json b/modules/bench/tsconfig.json
index d14d3c68..e41ea336 100644
--- a/modules/bench/tsconfig.json
+++ b/modules/bench/tsconfig.json
@@ -1,5 +1,5 @@
{
- "extends": "../../tsconfig.module.json",
+ "extends": "../../tsconfig.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
diff --git a/modules/env/test/lib/get-browser.spec.js b/modules/env/test/lib/get-browser.spec.js
index 71916a78..7ebc20e1 100644
--- a/modules/env/test/lib/get-browser.spec.js
+++ b/modules/env/test/lib/get-browser.spec.js
@@ -2,7 +2,7 @@
import test from 'tape-promise/tape';
import {getBrowser} from '@probe.gl/env';
-test('getBrowser', t => {
+test('getBrowser', (t) => {
t.equal(
getBrowser(
'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0'
diff --git a/modules/env/tsconfig.json b/modules/env/tsconfig.json
index e2cb21a9..0d894d27 100644
--- a/modules/env/tsconfig.json
+++ b/modules/env/tsconfig.json
@@ -1,5 +1,5 @@
{
- "extends": "../../tsconfig.module.json",
+ "extends": "../../tsconfig.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
diff --git a/modules/log/src/log.ts b/modules/log/src/log.ts
index aac2ecd4..414204c5 100644
--- a/modules/log/src/log.ts
+++ b/modules/log/src/log.ts
@@ -1,6 +1,6 @@
// probe.gl, MIT license
-/* eslint-disable no-console */
+/* eslint-disable no-console,prefer-rest-params */
import {VERSION, isBrowser} from '@probe.gl/env';
import {LocalStorage} from './utils/local-storage';
import {formatTime, leftPad} from './utils/formatters';
diff --git a/modules/log/src/utils/autobind.ts b/modules/log/src/utils/autobind.ts
index 2338a1c7..a630d478 100644
--- a/modules/log/src/utils/autobind.ts
+++ b/modules/log/src/utils/autobind.ts
@@ -30,7 +30,7 @@ export function autobind(obj: object, predefined = ['constructor']): void {
for (const key of propNames) {
const value = object[key];
if (typeof value === 'function') {
- if (!predefined.find(name => key === name)) {
+ if (!predefined.find((name) => key === name)) {
object[key] = value.bind(obj);
}
}
diff --git a/modules/log/test/lib/log.spec.js b/modules/log/test/lib/log.spec.js
index 7735edd6..55d265b3 100644
--- a/modules/log/test/lib/log.spec.js
+++ b/modules/log/test/lib/log.spec.js
@@ -2,7 +2,7 @@
import Probe, {Log} from '@probe.gl/log';
import test from 'tape-promise/tape';
-test('Log#import', t => {
+test('Log#import', (t) => {
t.equals(typeof Log, 'function', 'Log imported OK');
t.equals(typeof Probe, 'object', 'default (Probe) imported OK');
t.ok(
@@ -12,13 +12,13 @@ test('Log#import', t => {
t.end();
});
-test('Probe#probe', t => {
+test('Probe#probe', (t) => {
t.doesNotThrow(() => Probe.probe('test'), 'Probe.probe works');
t.doesNotThrow(() => Probe.probe(0, 'test'), 'Probe.probe works');
t.end();
});
-test('Probe#getTotal()', t => {
+test('Probe#getTotal()', (t) => {
const time1 = Probe.getTotal();
const time2 = Probe.getTotal();
t.ok(Number.isFinite(time1), 'Probe.getTotal() returned number');
@@ -27,7 +27,7 @@ test('Probe#getTotal()', t => {
t.end();
});
-test('Log#log', t => {
+test('Log#log', (t) => {
const log = new Log({id: 'test'});
t.ok(log instanceof Log, 'log created successfully');
t.doesNotThrow(() => log.log('test')(), 'log.log works');
@@ -35,7 +35,7 @@ test('Log#log', t => {
t.end();
});
-test('Log#log(functions)', t => {
+test('Log#log(functions)', (t) => {
const log = new Log({id: 'test'});
t.ok(log instanceof Log, 'log created successfully');
t.doesNotThrow(() => log.log(() => 'test')(), 'log.log works');
@@ -43,7 +43,7 @@ test('Log#log(functions)', t => {
t.end();
});
-test('Log#group - create, log, end', t => {
+test('Log#group - create, log, end', (t) => {
const log = new Log({id: 'test'});
t.ok(log instanceof Log, 'log created successfully');
@@ -53,7 +53,7 @@ test('Log#group - create, log, end', t => {
t.end();
});
-test('Log#log(functions2)', t => {
+test('Log#log(functions2)', (t) => {
const log = new Log({id: 'test'});
t.ok(log instanceof Log, 'log created successfully');
t.doesNotThrow(() => log.log(() => 'test')(), 'log.log works');
@@ -61,7 +61,7 @@ test('Log#log(functions2)', t => {
t.end();
});
-test('Log#once', t => {
+test('Log#once', (t) => {
const log = new Log({id: 'test'});
t.ok(log instanceof Log, 'log created successfully');
t.doesNotThrow(() => log.once('test')(), 'log.once works');
@@ -69,21 +69,21 @@ test('Log#once', t => {
t.end();
});
-test('Log#warn', t => {
+test('Log#warn', (t) => {
const log = new Log({id: 'test'});
t.ok(log instanceof Log, 'log created successfully');
t.doesNotThrow(() => log.warn('test')(), 'log.warn works');
t.end();
});
-test('Log#error', t => {
+test('Log#error', (t) => {
const log = new Log({id: 'test'});
t.ok(log instanceof Log, 'log created successfully');
t.doesNotThrow(() => log.error('test')(), 'log.error works');
t.end();
});
-test('Log#assert', t => {
+test('Log#assert', (t) => {
const log = new Log({id: 'test'});
t.ok(log instanceof Log, 'log created successfully');
t.doesNotThrow(() => log.assert(true, 'test'), 'log.assert works');
@@ -91,7 +91,7 @@ test('Log#assert', t => {
t.end();
});
-test('Log#table', t => {
+test('Log#table', (t) => {
const log = new Log({id: 'test'});
t.ok(log instanceof Log, 'log created successfully');
t.doesNotThrow(() => log.table(0, {a: {c: 1}, b: {c: 2}})(), 'log.table works');
@@ -99,21 +99,21 @@ test('Log#table', t => {
t.end();
});
-test('Log#get', t => {
+test('Log#get', (t) => {
const log = new Log({id: 'test'});
t.ok(log instanceof Log, 'log created successfully');
t.doesNotThrow(() => log.get('level'), "log.get('level') works");
t.end();
});
-test('Log#set', t => {
+test('Log#set', (t) => {
const log = new Log({id: 'test'});
t.ok(log instanceof Log, 'log created successfully');
t.doesNotThrow(() => log.set('level', 1), "log.set('level', 1) works");
t.end();
});
-test('Log#settings', t => {
+test('Log#settings', (t) => {
const log = new Log({id: 'test'});
t.ok(log instanceof Log, 'log created successfully');
t.doesNotThrow(() => log.settings(), 'log.settings() works');
diff --git a/modules/log/test/lib/normalize-arguments.spec.js b/modules/log/test/lib/normalize-arguments.spec.js
index 68c600c6..bce7fb25 100644
--- a/modules/log/test/lib/normalize-arguments.spec.js
+++ b/modules/log/test/lib/normalize-arguments.spec.js
@@ -28,7 +28,7 @@ const NORMALIZE_ARGUMENTS_TEST_CASES = [
// }
];
-test('normalizeArguments', t => {
+test('normalizeArguments', (t) => {
for (const tc of NORMALIZE_ARGUMENTS_TEST_CASES) {
const opts = normalizeArguments({...tc.args});
diff --git a/modules/log/test/utils/get-hi-res-timestamp.spec.js b/modules/log/test/utils/get-hi-res-timestamp.spec.js
index 6c979e47..0190feab 100644
--- a/modules/log/test/utils/get-hi-res-timestamp.spec.js
+++ b/modules/log/test/utils/get-hi-res-timestamp.spec.js
@@ -1,7 +1,7 @@
import test from 'tape-promise/tape';
import {getHiResTimestamp} from '@probe.gl/log';
-test('getHiResTimestamp', t => {
+test('getHiResTimestamp', (t) => {
const t1hr = getHiResTimestamp();
const t1d = Date.now();
t.equals(typeof getHiResTimestamp, 'function', 'getHiResTimestamp imported OK');
diff --git a/modules/log/tsconfig.json b/modules/log/tsconfig.json
index cbe5a860..f74c73dd 100644
--- a/modules/log/tsconfig.json
+++ b/modules/log/tsconfig.json
@@ -1,5 +1,5 @@
{
- "extends": "../../tsconfig.module.json",
+ "extends": "../../tsconfig.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
diff --git a/modules/react-bench/tsconfig.json b/modules/react-bench/tsconfig.json
index 3ded2a3e..fad73c69 100644
--- a/modules/react-bench/tsconfig.json
+++ b/modules/react-bench/tsconfig.json
@@ -1,5 +1,5 @@
{
- "extends": "../../tsconfig.module.json",
+ "extends": "../../tsconfig.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
diff --git a/modules/seer/test/api.spec.js b/modules/seer/test/api.spec.js
index aae2c191..cd52183a 100644
--- a/modules/seer/test/api.spec.js
+++ b/modules/seer/test/api.spec.js
@@ -26,13 +26,13 @@ import {spy} from 'sinon';
import api from '../src/api';
-test('[API] check exports', t => {
+test('[API] check exports', (t) => {
t.truthy(api, 'The global object is defined');
t.truthy(Object.keys(api).length, 'Some methods are exported');
t.truthy(api.send, 'The send method is defined');
});
-test('[API] send', t => {
+test('[API] send', (t) => {
const postMessage = spy();
window.postMessage = postMessage;
@@ -48,7 +48,7 @@ test('[API] send', t => {
});
// eslint-disable-next-line max-statements
-test('[API] listeners', t => {
+test('[API] listeners', (t) => {
const addEventListener = spy();
window.addEventListener = addEventListener;
@@ -91,10 +91,10 @@ test('[API] listeners', t => {
t.falsy(window.__SEER_LISTENER__);
t.truthy(removeEventListener.calledOnce, 'The listener should have been removed');
- api.listenFor('deck.gl', f => f);
+ api.listenFor('deck.gl', (f) => f);
});
-test('[API] methods', t => {
+test('[API] methods', (t) => {
const postMessage = spy();
window.postMessage = postMessage;
// @ts-expect-error
diff --git a/modules/seer/tsconfig.json b/modules/seer/tsconfig.json
index a2679754..05253d3e 100644
--- a/modules/seer/tsconfig.json
+++ b/modules/seer/tsconfig.json
@@ -1,5 +1,5 @@
{
- "extends": "../../tsconfig.module.json",
+ "extends": "../../tsconfig.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
diff --git a/modules/stats-widget/src/stats-widget.ts b/modules/stats-widget/src/stats-widget.ts
index 06f3feb9..37e335f6 100644
--- a/modules/stats-widget/src/stats-widget.ts
+++ b/modules/stats-widget/src/stats-widget.ts
@@ -28,14 +28,14 @@ const DEFAULT_CSS = {
export type StatFormatter = (stat: Stat) => string;
-const DEFAULT_COUNT_FORMATTER = stat => `${stat.name}: ${stat.count}`;
+const DEFAULT_COUNT_FORMATTER = (stat) => `${stat.name}: ${stat.count}`;
export const DEFAULT_FORMATTERS: Record = {
count: DEFAULT_COUNT_FORMATTER,
- averageTime: stat => `${stat.name}: ${formatTime(stat.getAverageTime())}`,
- totalTime: stat => `${stat.name}: ${formatTime(stat.time)}`,
- fps: stat => `${stat.name}: ${Math.round(stat.getHz())}fps`,
- memory: stat => `${stat.name}: ${formatMemory(stat.count)}`
+ averageTime: (stat) => `${stat.name}: ${formatTime(stat.getAverageTime())}`,
+ totalTime: (stat) => `${stat.name}: ${formatTime(stat.time)}`,
+ fps: (stat) => `${stat.name}: ${Math.round(stat.getHz())}fps`,
+ memory: (stat) => `${stat.name}: ${formatMemory(stat.count)}`
};
export type StatWidgetProps = {
@@ -131,7 +131,7 @@ export default class StatsWidget {
_update(): void {
// make sure that we clear the old text before drawing new text.
- this.stats.forEach(stat => {
+ this.stats.forEach((stat) => {
this._createDOMItem(stat.name);
this._items[stat.name].innerHTML = this._getLines(stat).join('
');
@@ -218,7 +218,7 @@ export default class StatsWidget {
_createDOMStats(): void {
if (this.stats instanceof Stats) {
- this.stats.forEach(stat => {
+ this.stats.forEach((stat) => {
this._createDOMItem(stat.name);
});
}
diff --git a/modules/stats-widget/test/format-utils.spec.js b/modules/stats-widget/test/format-utils.spec.js
index f58ecbf4..0f5a9ee9 100644
--- a/modules/stats-widget/test/format-utils.spec.js
+++ b/modules/stats-widget/test/format-utils.spec.js
@@ -1,7 +1,7 @@
import test from 'tape-promise/tape';
import {formatTime, formatMemory} from '@probe.gl/stats-widget/format-utils';
-test('StatsWidget#formatTime', t => {
+test('StatsWidget#formatTime', (t) => {
t.equals(typeof formatTime, 'function', 'formatTime import OK');
t.equals(formatTime(1), '1.00ms');
@@ -12,7 +12,7 @@ test('StatsWidget#formatTime', t => {
t.end();
});
-test('StatsWidget#formatMemory', t => {
+test('StatsWidget#formatMemory', (t) => {
t.equals(typeof formatMemory, 'function', 'formatMemory import OK');
t.equals(formatMemory(1), '1 bytes');
diff --git a/modules/stats-widget/test/stats-widget.spec.js b/modules/stats-widget/test/stats-widget.spec.js
index 113c21de..b81f9bae 100644
--- a/modules/stats-widget/test/stats-widget.spec.js
+++ b/modules/stats-widget/test/stats-widget.spec.js
@@ -29,12 +29,12 @@ function getStatsObject() {
return stats;
}
-test('StatsWidget#import', t => {
+test('StatsWidget#import', (t) => {
t.equals(typeof StatsWidget, 'function', 'Stats import OK');
t.end();
});
-test('StatsWidget#Constructor with no stats or options', t => {
+test('StatsWidget#Constructor with no stats or options', (t) => {
const statsWidget = new StatsWidget(null);
t.ok(statsWidget._container, 'Should create a dom container.');
t.ok(statsWidget._header, 'Should create a dom header.');
@@ -54,7 +54,7 @@ test('StatsWidget#Constructor with no stats or options', t => {
t.end();
});
-test('StatsWidget#Constructor with container', t => {
+test('StatsWidget#Constructor with container', (t) => {
const container = _global.document.createElement('div');
container.id = 'test-stats-widget-container';
const statsWidget = new StatsWidget(null, {container});
@@ -63,7 +63,7 @@ test('StatsWidget#Constructor with container', t => {
t.end();
});
-test('StatsWidget#setStats', t => {
+test('StatsWidget#setStats', (t) => {
const container = _global.document.createElement('div');
container.id = 'test-stats-widget-container';
const statsWidget = new StatsWidget(null, {container});
@@ -83,7 +83,7 @@ test('StatsWidget#setStats', t => {
t.end();
});
-test('StatsWidget#collapse', t => {
+test('StatsWidget#collapse', (t) => {
const container = _global.document.createElement('div');
container.id = 'test-stats-widget-container';
const statsWidget = new StatsWidget(getStatsObject(), {container});
@@ -106,7 +106,7 @@ test('StatsWidget#collapse', t => {
});
/* eslint-disable */
-test('StatsWidget#Update stats', t => {
+test('StatsWidget#Update stats', (t) => {
const container = _global.document.createElement('div');
container.id = 'test-stats-widget-container';
const statsWidget = new StatsWidget(null, {container});
@@ -141,7 +141,7 @@ test('StatsWidget#Update stats', t => {
t.end();
});
-test('StatsWidget#formatters', t => {
+test('StatsWidget#formatters', (t) => {
// @ts-expect-error
const container = _global.document.createElement('div');
container.id = 'test-stats-widget-container';
@@ -149,7 +149,7 @@ test('StatsWidget#formatters', t => {
container,
formatters: {
'GPU Memory': 'count',
- Count: stat => `${stat.name}: ${(stat.count / 1000).toFixed(1)}k`
+ Count: (stat) => `${stat.name}: ${(stat.count / 1000).toFixed(1)}k`
}
});
const stats = getStatsObject();
@@ -181,7 +181,7 @@ test('StatsWidget#formatters', t => {
t.end();
});
-test('StatsWidget#resetOnUpdate', t => {
+test('StatsWidget#resetOnUpdate', (t) => {
// @ts-expect-error
const container = _global.document.createElement('div');
container.id = 'test-stats-widget-container';
@@ -204,7 +204,7 @@ test('StatsWidget#resetOnUpdate', t => {
t.end();
});
-test('StatsWidget#remove', t => {
+test('StatsWidget#remove', (t) => {
const container = _global.document.createElement('div');
container.id = 'test-stats-widget-container';
const statsWidget = new StatsWidget(null, {container});
diff --git a/modules/stats-widget/tsconfig.json b/modules/stats-widget/tsconfig.json
index 712307c6..593810de 100644
--- a/modules/stats-widget/tsconfig.json
+++ b/modules/stats-widget/tsconfig.json
@@ -1,5 +1,5 @@
{
- "extends": "../../tsconfig.module.json",
+ "extends": "../../tsconfig.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
diff --git a/modules/stats/test/get-hi-res-timestamp.spec.js b/modules/stats/test/get-hi-res-timestamp.spec.js
index 293acb50..77bd595f 100644
--- a/modules/stats/test/get-hi-res-timestamp.spec.js
+++ b/modules/stats/test/get-hi-res-timestamp.spec.js
@@ -1,7 +1,7 @@
import test from 'tape-promise/tape';
import {_getHiResTimestamp} from '@probe.gl/stats';
-test('_getHiResTimestamp', t => {
+test('_getHiResTimestamp', (t) => {
const t1hr = _getHiResTimestamp();
const t1d = Date.now();
t.equals(typeof _getHiResTimestamp, 'function', '_getHiResTimestamp imported OK');
diff --git a/modules/stats/test/stats.spec.js b/modules/stats/test/stats.spec.js
index c6d3e1c6..0e598415 100644
--- a/modules/stats/test/stats.spec.js
+++ b/modules/stats/test/stats.spec.js
@@ -2,12 +2,12 @@
import {Stats, Stat} from '@probe.gl/stats';
import test from 'tape-promise/tape';
-test('Stats#import', t => {
+test('Stats#import', (t) => {
t.equals(typeof Stats, 'function', 'Stats import OK');
t.end();
});
-test('Stats#counting', t => {
+test('Stats#counting', (t) => {
const stats = new Stats({id: 'test'});
const counter = stats.get('test');
t.doesNotThrow(() => counter.incrementCount(), 'stat.incrementCount works');
@@ -19,7 +19,7 @@ test('Stats#counting', t => {
t.end();
});
-test('Stats#timer()', t => {
+test('Stats#timer()', (t) => {
const stats = new Stats({id: 'test'});
const timer = stats.get('test');
t.doesNotThrow(() => timer.timeStart(), 'timer.timeStart works');
@@ -34,7 +34,7 @@ test('Stats#timer()', t => {
t.end();
});
-test('Stats#reset()', t => {
+test('Stats#reset()', (t) => {
const stats = new Stats({id: 'test'});
const stat = stats.get('test');
stat.incrementCount();
@@ -49,7 +49,7 @@ test('Stats#reset()', t => {
t.end();
});
-test('Stats#timing sampleSize', t => {
+test('Stats#timing sampleSize', (t) => {
const stats = new Stats({id: 'test'});
const stat = stats.get('test').setSampleSize(3);
stat.addTime(0);
@@ -69,7 +69,7 @@ test('Stats#timing sampleSize', t => {
t.end();
});
-test('Stats#timing sampleSize', t => {
+test('Stats#timing sampleSize', (t) => {
const stats = new Stats({id: 'test'});
const stat = stats.get('test').setSampleSize(3);
stat.incrementCount();
@@ -85,7 +85,7 @@ test('Stats#timing sampleSize', t => {
t.end();
});
-test('Stats#constructore with stats', t => {
+test('Stats#constructore with stats', (t) => {
const statsContent = new Stats({
id: 'test',
stats: [
diff --git a/modules/stats/tsconfig.json b/modules/stats/tsconfig.json
index 3e8b54ca..37609993 100644
--- a/modules/stats/tsconfig.json
+++ b/modules/stats/tsconfig.json
@@ -1,5 +1,5 @@
{
- "extends": "../../tsconfig.module.json",
+ "extends": "../../tsconfig.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
diff --git a/modules/test-utils/src/browser-automation/browser-driver.ts b/modules/test-utils/src/browser-automation/browser-driver.ts
index 48b5394d..c9dd0392 100644
--- a/modules/test-utils/src/browser-automation/browser-driver.ts
+++ b/modules/test-utils/src/browser-automation/browser-driver.ts
@@ -76,7 +76,7 @@ export default class BrowserDriver {
this.page.setDefaultNavigationTimeout(0);
// attach events
- const onRequestFail = evt => {
+ const onRequestFail = (evt) => {
onError(new Error(`cannot load ${evt.url()}`));
};
this.page.on('console', onConsole);
@@ -166,10 +166,10 @@ async function startServerCLI(config: ServerConfiguration): Promise {
- server.stdout.on('data', data => {
+ server.stdout.on('data', (data) => {
console.log(data.toString());
});
- server.stderr.on('data', data => {
+ server.stderr.on('data', (data) => {
console.error(data.toString());
});
server.on('close', onClose);
diff --git a/modules/test-utils/src/browser-automation/browser-test-driver.ts b/modules/test-utils/src/browser-automation/browser-test-driver.ts
index 0d7ac55f..be88bf53 100644
--- a/modules/test-utils/src/browser-automation/browser-test-driver.ts
+++ b/modules/test-utils/src/browser-automation/browser-test-driver.ts
@@ -98,48 +98,48 @@ export default class BrowserTestDriver extends BrowserDriver {
_openPage(url: string, config: BrowserTestDriverProps): Promise {
const browserConfig = Object.assign({}, config.browser, {headless: this.headless});
- return this.startBrowser(browserConfig).then(
- _ =>
- new Promise(async (resolve, reject) => {
- const exposeFunctions = {
- ...config.exposeFunctions,
- browserTestDriver_fail: () => this.failures++,
- browserTestDriver_finish: message => resolve(message),
- browserTestDriver_emulateInput: event => this._emulateInput(event),
- browserTestDriver_captureAndDiffScreen: opts => this._captureAndDiff(opts)
- };
-
- // Puppeteer can only inject functions, not values, into the global scope
- // In headless mode, we inject the function so it's truthy
- // In non-headless mode, we don't inject the function so it's undefined
- if (this.headless) {
- exposeFunctions.browserTestDriver_isHeadless = () => true;
- }
-
- this.logger.log({
- message: 'Loading page in browser...',
- color: COLOR.BRIGHT_YELLOW
- })();
-
- // resolve URL
- const pageUrl: string = config.url
- ? config.url.startsWith('http')
- ? config.url
- : `${url.replace(/\/$/, '')}/${config.url.replace(/^\//, '')}`
- : url;
-
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
- const page = await this.openPage({
- exposeFunctions,
- onConsole: event => this._onConsole(event),
- onError: reject
- });
-
- await config.onStart?.({page});
-
- await page.goto(pageUrl);
- })
- );
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
+ return new Promise(async (resolve, reject) => {
+ await this.startBrowser(browserConfig);
+
+ const exposeFunctions = {
+ ...config.exposeFunctions,
+ browserTestDriver_fail: () => this.failures++,
+ browserTestDriver_finish: (message) => resolve(message),
+ browserTestDriver_emulateInput: (event) => this._emulateInput(event),
+ browserTestDriver_captureAndDiffScreen: (opts) => this._captureAndDiff(opts)
+ };
+
+ // Puppeteer can only inject functions, not values, into the global scope
+ // In headless mode, we inject the function so it's truthy
+ // In non-headless mode, we don't inject the function so it's undefined
+ if (this.headless) {
+ exposeFunctions.browserTestDriver_isHeadless = () => true;
+ }
+
+ this.logger.log({
+ message: 'Loading page in browser...',
+ color: COLOR.BRIGHT_YELLOW
+ })();
+
+ // resolve URL
+ const pageUrl: string = config.url
+ ? config.url.startsWith('http')
+ ? config.url
+ : `${url.replace(/\/$/, '')}/${config.url.replace(/^\//, '')}`
+ : url;
+
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
+ const page = await this.openPage({
+ exposeFunctions,
+ onConsole: (event) => this._onConsole(event),
+ onError: reject
+ });
+
+ await config.onStart?.({page});
+
+ await page.goto(pageUrl);
+ });
}
/* eslint-disable no-console */
@@ -273,7 +273,7 @@ export default class BrowserTestDriver extends BrowserDriver {
message: `Writing screenshot to ${filename}`,
color: COLOR.BRIGHT_YELLOW
})();
- fs.writeFile(filename, data, error => {
+ fs.writeFile(filename, data, (error) => {
if (error) {
this.logger.log({
message: `Save screenshot failed: ${error.message}`,
diff --git a/modules/test-utils/src/utils/diff-images.ts b/modules/test-utils/src/utils/diff-images.ts
index f6711ce4..c06ceea5 100644
--- a/modules/test-utils/src/utils/diff-images.ts
+++ b/modules/test-utils/src/utils/diff-images.ts
@@ -119,7 +119,7 @@ function parsePNG(source: string | Buffer): Promise {
if (source instanceof Buffer) {
// puppeteer.screenshot returns a Buffer object
return new Promise((resolve, reject) => {
- image.parse(source, (error, data) => {
+ image.parse(source, (error) => {
if (error) {
reject(error);
} else {
diff --git a/modules/test-utils/src/utils/process-utils.ts b/modules/test-utils/src/utils/process-utils.ts
index d8c4c780..2d2759d3 100644
--- a/modules/test-utils/src/utils/process-utils.ts
+++ b/modules/test-utils/src/utils/process-utils.ts
@@ -3,9 +3,9 @@ import ChildProcess from 'child_process';
// Get an available port
// Works on Unix systems
export function getAvailablePort(defaultPort: number = 3000): Promise {
- return new Promise((resolve, reject) => {
+ return new Promise((resolve) => {
// Get a list of all ports in use
- ChildProcess.exec('lsof -i -P -n | grep LISTEN', (error, stdout, stderr) => {
+ ChildProcess.exec('lsof -i -P -n | grep LISTEN', (error, stdout) => {
if (error) {
// likely no permission, e.g. CI
resolve(defaultPort);
@@ -14,7 +14,7 @@ export function getAvailablePort(defaultPort: number = 3000): Promise {
const portsInUse: number[] = [];
const regex = /:(\d+) \(LISTEN\)/;
- stdout.split('\n').forEach(line => {
+ stdout.split('\n').forEach((line) => {
const match = regex.exec(line);
if (match) {
portsInUse.push(Number(match[1]));
diff --git a/modules/test-utils/test/browser-driver.spec.js b/modules/test-utils/test/browser-driver.spec.js
index 46f13d6a..437cfa3b 100644
--- a/modules/test-utils/test/browser-driver.spec.js
+++ b/modules/test-utils/test/browser-driver.spec.js
@@ -2,7 +2,7 @@ import test from 'tape-promise/tape';
import {BrowserDriver} from '@probe.gl/test-utils';
-test('BrowserDriver#import', t => {
+test('BrowserDriver#import', (t) => {
t.ok(BrowserDriver, 'BrowserDriver symbol imported');
t.end();
});
diff --git a/modules/test-utils/test/browser-test-driver.spec.js b/modules/test-utils/test/browser-test-driver.spec.js
index e9a7a449..8d79652c 100644
--- a/modules/test-utils/test/browser-test-driver.spec.js
+++ b/modules/test-utils/test/browser-test-driver.spec.js
@@ -29,12 +29,12 @@ function createTestCanvas() {
return canvas;
}
-test('BrowserTestDriver#import', t => {
+test('BrowserTestDriver#import', (t) => {
t.ok(BrowserTestDriver, 'BrowserTestDriver symbol imported');
t.end();
});
-test('BrowserTestDriver#ImageDiff', async t => {
+test('BrowserTestDriver#ImageDiff', async (t) => {
if (typeof document === 'undefined' || !window.browserTestDriver_captureAndDiffScreen) {
t.comment('ImageDiff only works in automated browser tests');
t.end();
diff --git a/modules/test-utils/test/diff-images.spec.js b/modules/test-utils/test/diff-images.spec.js
index 54513ae6..ddf3a110 100644
--- a/modules/test-utils/test/diff-images.spec.js
+++ b/modules/test-utils/test/diff-images.spec.js
@@ -3,7 +3,7 @@ import {isBrowser} from '@probe.gl/env';
import {_diffImages as diffImages} from '@probe.gl/test-utils';
-test('diffImage', async t => {
+test('diffImage', async (t) => {
if (isBrowser()) {
t.comment('diffImage is node only');
t.end();
@@ -16,7 +16,7 @@ test('diffImage', async t => {
title: 'identical images',
source1: `${dataDir}/icon-marker.png`,
source2: `${dataDir}/icon-marker-2.png`,
- testMatch: match => match === 1,
+ testMatch: (match) => match === 1,
success: true
},
{
diff --git a/modules/test-utils/test/make-spy.spec.js b/modules/test-utils/test/make-spy.spec.js
index 59cb2c26..332c94d1 100644
--- a/modules/test-utils/test/make-spy.spec.js
+++ b/modules/test-utils/test/make-spy.spec.js
@@ -2,7 +2,7 @@ import test from 'tape-promise/tape';
import {makeSpy} from '@probe.gl/test-utils';
-test('import "@probe.gl/test-utils"', t => {
+test('import "@probe.gl/test-utils"', (t) => {
t.ok(typeof makeSpy, 'makeSpy symbol imported');
t.end();
});
diff --git a/modules/test-utils/tsconfig.json b/modules/test-utils/tsconfig.json
index 3b894e17..1ebd4c9f 100644
--- a/modules/test-utils/tsconfig.json
+++ b/modules/test-utils/tsconfig.json
@@ -1,5 +1,5 @@
{
- "extends": "../../tsconfig.module.json",
+ "extends": "../../tsconfig.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
diff --git a/package.json b/package.json
index 4981ae52..0d047f02 100644
--- a/package.json
+++ b/package.json
@@ -22,20 +22,20 @@
"jsdom": false
},
"scripts": {
- "bootstrap": "yarn && ocular-bootstrap",
- "clean": "ocular-clean",
- "build": "ocular-build",
+ "bootstrap": "yarn && ocular-bootstrap && npm run build",
+ "build": "ocular-clean && ocular-build",
"lint": "ocular-lint",
- "publish": "ocular-publish",
+ "publish-prod": "ocular-publish version-only-prod",
+ "publish-beta": "ocular-publish version-only-beta",
"test": "ocular-test",
- "test-fast": "ocular-test fast",
- "version": "ocular-build env"
+ "test-fast": "ocular-lint pre-commit && ocular-test node"
},
"devDependencies": {
"@types/tape-promise": "^4.0.1",
+ "@vis.gl/dev-tools": "1.0.0-alpha.15",
+ "@vis.gl/ts-plugins": "1.0.0-alpha.15",
"jsdoc-to-markdown": "^3.0.0",
"jsdom": "^16.5.0",
- "ocular-dev-tools": "2.0.0-alpha.28",
"pre-commit": "^1.2.2",
"puppeteer": "^22.0.0",
"react-dom": "^16.13.1",
diff --git a/test/bench/samples.bench.ts b/test/bench/samples.bench.ts
index af161bdd..4e9c9dd4 100644
--- a/test/bench/samples.bench.ts
+++ b/test/bench/samples.bench.ts
@@ -5,18 +5,18 @@ import type {Bench} from '@probe.gl/bench';
// TODO - dummy benchmark - should replace with log related benchmark
const arr = [1, 1, 1, 1];
-const someFn = i => ((((i * 3 * 8) / 1200) * 0.002) / 40) * 0.2;
+const someFn = (i) => ((((i * 3 * 8) / 1200) * 0.002) / 40) * 0.2;
let sumForEach = 0;
let sumMap = 0;
let sumFor = 0;
-export default function addBenchmarks(suite: Bench, addReferenceBenchmarks: boolean): Bench {
+export default function addBenchmarks(suite: Bench): Bench {
suite
.group('Javascript Array benchmark')
- .add('Array.forEach', () => arr.forEach(item => (sumForEach += someFn(item))))
+ .add('Array.forEach', () => arr.forEach((item) => (sumForEach += someFn(item))))
.add('Array.reduce', () => arr.reduce((sumReduce, item) => (sumReduce += someFn(item)), 0))
- .add('Array.map', () => arr.map(item => (sumMap += someFn(item))))
+ .add('Array.map', () => arr.map((item) => (sumMap += someFn(item))))
.add('For loop', () => {
for (let j = 0; j < arr.length; j++) {
sumFor = sumFor + someFn(arr[j]);
diff --git a/test/browser.js b/test/browser.js
index 2203f7de..4f10f5e2 100644
--- a/test/browser.js
+++ b/test/browser.js
@@ -31,7 +31,7 @@ test.onFinish(globalThis.browserTestDriver_finish);
// tap-browser-color alternative
enableDOMLogging({
- getStyle: message => ({background: failed ? '#F28E82' : '#8ECA6C'})
+ getStyle: (message) => ({background: failed ? '#F28E82' : '#8ECA6C'})
});
import './test-index';
diff --git a/index.html b/test/index.html
similarity index 65%
rename from index.html
rename to test/index.html
index 67a5fff8..6f9c30e7 100644
--- a/index.html
+++ b/test/index.html
@@ -4,5 +4,6 @@
probe.gl tests
+