From 58974da324314c508084eb50047dd439e19e4bef Mon Sep 17 00:00:00 2001 From: Kenny Daniel Date: Wed, 3 Jan 2024 13:07:08 -0800 Subject: [PATCH] JS tests --- .eslintrc.json | 6 +++++- test/{metadata.test.ts => metadata.test.js} | 9 +++++++-- test/{package.test.ts => package.test.js} | 0 test/{snappy.test.ts => snappy.test.js} | 0 test/{thrift.test.ts => thrift.test.js} | 0 5 files changed, 12 insertions(+), 3 deletions(-) rename test/{metadata.test.ts => metadata.test.js} (92%) rename test/{package.test.ts => package.test.js} (100%) rename test/{snappy.test.ts => snappy.test.js} (100%) rename test/{thrift.test.ts => thrift.test.js} (100%) diff --git a/.eslintrc.json b/.eslintrc.json index 1269690..b0ffb24 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,4 +1,7 @@ { + "env": { + "node": true + }, "parser": "@typescript-eslint/parser", "extends": [ "eslint:recommended", @@ -30,7 +33,8 @@ "jsdoc/check-param-names": "error", "jsdoc/check-property-names": "error", "jsdoc/check-tag-names": "error", - "jsdoc/no-types": "error", + "jsdoc/require-param-type": "warn", + "jsdoc/require-returns-type": "warn", "jsdoc/sort-tags": "error", "no-constant-condition": "off", "no-multi-spaces": "error", diff --git a/test/metadata.test.ts b/test/metadata.test.js similarity index 92% rename from test/metadata.test.ts rename to test/metadata.test.js index 9cd470d..05cae21 100644 --- a/test/metadata.test.ts +++ b/test/metadata.test.js @@ -2,8 +2,13 @@ import { promises as fs } from 'fs' import { describe, expect, it } from 'vitest' import { castBigInts, parquetMetadata } from '../src/metadata' -// Helper function to read .parquet file into ArrayBuffer -async function readFileToArrayBuffer(filePath: string): Promise { +/** + * Helper function to read .parquet file into ArrayBuffer + * + * @param {string} filePath + * @returns {Promise} + */ +async function readFileToArrayBuffer(filePath) { const buffer = await fs.readFile(filePath) return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength) } diff --git a/test/package.test.ts b/test/package.test.js similarity index 100% rename from test/package.test.ts rename to test/package.test.js diff --git a/test/snappy.test.ts b/test/snappy.test.js similarity index 100% rename from test/snappy.test.ts rename to test/snappy.test.js diff --git a/test/thrift.test.ts b/test/thrift.test.js similarity index 100% rename from test/thrift.test.ts rename to test/thrift.test.js