Skip to content

Commit 6093bb7

Browse files
committed
feat(test): add useful unit tests
1 parent a6db85f commit 6093bb7

42 files changed

Lines changed: 11221 additions & 10505 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 0 additions & 110 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,4 @@ dist
107107
docs/v2
108108

109109
# testing
110-
testServer/
110+
testServer/

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.9.0

.yaml-lint.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
[![Discord](https://dcbadge.vercel.app/api/server/xWRaCDBtW4?style=flat)](https://discord.gg/xWRaCDBtW4) [![CI](https://github.com/deepgram/node-sdk/actions/workflows/CI.yml/badge.svg)](https://github.com/deepgram/node-sdk/actions/workflows/CI.yml) [![npm (scoped)](https://img.shields.io/npm/v/@deepgram/sdk)](https://www.npmjs.com/package/@deepgram/sdk) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg?style=flat-rounded)](CODE_OF_CONDUCT.md)
44

5-
Official JavaScript SDK for [Deepgram](https://www.deepgram.com/). Power your apps with world-class speech and Language AI models.
5+
> 🎯 **Development Setup**: This project uses [Corepack](https://nodejs.org/api/corepack.html) for package manager consistency. Run `corepack enable` once, then use `pnpm` commands normally. See [DEVELOPMENT.md](./DEVELOPMENT.md) for details.
6+
7+
Isomorphic Javascript client for Deepgram's automated speech recognition APIs.
68

79
- [Documentation](#documentation)
810
- [Migrating from earlier versions](#migrating-from-earlier-versions)

disabled_tests/live.test.ts

Lines changed: 0 additions & 76 deletions
This file was deleted.

jest.config.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/** @type {import('jest').Config} */
2+
/* eslint-env node */
3+
module.exports = {
4+
preset: "ts-jest",
5+
testEnvironment: "node",
6+
7+
// Test file patterns
8+
testMatch: ["<rootDir>/tests/**/*.test.ts", "<rootDir>/tests/**/*.spec.ts"],
9+
10+
// Module path mapping
11+
moduleNameMapper: {
12+
"^@/(.*)$": "<rootDir>/src/$1",
13+
"^@deepgram/sdk$": "<rootDir>/src/index.ts",
14+
},
15+
16+
// Setup files
17+
setupFilesAfterEnv: ["<rootDir>/tests/setup.ts"],
18+
19+
// Coverage configuration
20+
collectCoverageFrom: [
21+
"src/**/*.ts",
22+
"!src/**/*.d.ts",
23+
"!src/**/index.ts",
24+
"!src/**/__tests__/**",
25+
"!src/**/__mocks__/**",
26+
],
27+
28+
coverageDirectory: "coverage",
29+
coverageReporters: ["text", "lcov", "html", "json"],
30+
31+
// Test timeout
32+
testTimeout: 10000,
33+
34+
// Transform configuration
35+
transform: {
36+
"^.+\\.ts$": [
37+
"ts-jest",
38+
{
39+
tsconfig: "tsconfig.json",
40+
},
41+
],
42+
},
43+
44+
// Module file extensions
45+
moduleFileExtensions: ["ts", "js", "json"],
46+
47+
// Clear mocks between tests
48+
clearMocks: true,
49+
restoreMocks: true,
50+
};

0 commit comments

Comments
 (0)