Skip to content

Commit

Permalink
refactor: move tests to typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjoDiaz committed May 24, 2023
1 parent 8c88bc7 commit efa8339
Show file tree
Hide file tree
Showing 37 changed files with 11,523 additions and 28 deletions.
161 changes: 161 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
},
"devDependencies": {
"@types/lodash.get": "^4.4.7",
"@types/tape": "^4.13.2",
"@typescript-eslint/eslint-plugin": "^5.46.1",
"@typescript-eslint/parser": "^5.46.1",
"c8": "^7.11.3",
Expand All @@ -63,6 +64,7 @@
"tap-spec": "^5.0.0",
"tape": "^5.2.2",
"tiny-glob": "^0.2.9",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"build:mjs": "tsc --module esnext --outDir ./bin",
"build": "npm run build:mjs",
"pretest": "npm run build",
"test:raw": "node test",
"test:raw": "ts-node --esm test/index.ts",
"test": "npm run test:raw | tap-spec",
"test-with-coverage": "c8 --reporter=text npm test",
"dependencies:update-internal": "npm uninstall @json2csv/formatters @json2csv/node @json2csv/transforms && npm install @json2csv/formatters @json2csv/node @json2csv/transforms",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/json2csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ async function getInputFromStdin<TRaw>(ndjson: boolean): Promise<Array<TRaw>> {
resolve(
ndjson ? parseNdJson(inputData, os.EOL) : JSON.parse(inputData)
);
} catch (err) {
} catch (err: unknown) {
reject(new Error(`Invalid data received from stdin (${err})`));
}
});
Expand Down
Loading

0 comments on commit efa8339

Please sign in to comment.