Skip to content

Commit

Permalink
test: removed bable in favor of ts-jest
Browse files Browse the repository at this point in the history
  • Loading branch information
manchuck committed Jul 3, 2024
1 parent 24103b0 commit 3a0e825
Show file tree
Hide file tree
Showing 283 changed files with 2,231 additions and 3,406 deletions.
74 changes: 0 additions & 74 deletions .eslintrc

This file was deleted.

15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node: [16.x, 18.x, 20.x]
node: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v3

Expand All @@ -31,8 +31,17 @@ jobs:
- name: Install packages
run: npm install

- name: Compile, Test
run: npm run compile && npm run test -- --coverage --verbose --maxWorkers=1
# Run lint before building to prevent eslint from checking the compiled files
- name: Lint
run: npm run lint

- name: Compile
run: npm run compile

- name: Test
env:
NODE_OPTIONS: "--max_old_space_size=8192"
run: npm run test

- name: Run codecov
uses: codecov/codecov-action@v3
Expand Down
25 changes: 0 additions & 25 deletions babel.config.js

This file was deleted.

41 changes: 41 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// eslint-disable-next-line n/no-extraneous-import
import globals from 'globals';
import vonage from '@vonage/eslint-config';

export default [
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
...globals.jest,
}
},
},
{
files: ['packages/*/lib/**/*.{ts,tsx}'],
},
{
ignores: ['packages/*/dist/**/*.js', 'coverage/**'],
},
...vonage.configs.typescript,
...vonage.configs.jest,
...vonage.configs.node,
{
settings: {
node: {
version: '>=18.0.0',
}
},
rules: {
// Leave this off. This rule cannot handle monorepos
'n/no-missing-import': ['off'],
'n/no-unsupported-features/es-builtins': [
'error', {
'ignores': []
}]
},
},

];
38 changes: 35 additions & 3 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,140 +1,172 @@
// eslint-disable-next-line n/no-extraneous-import
import type { Config } from '@jest/types';

const projectDefault = {
testEnvironment: 'node',
preset: 'ts-jest/presets/default-esm',
moduleNameMapper: {
'@vonage/(.+)': '<rootDir>/packages/$1/lib',
},
};

const config: Config.InitialOptions = {
extensionsToTreatAsEsm: ['.ts'],
coverageDirectory: '<rootDir>/coverage/',
coveragePathIgnorePatterns: [
'node_modules',
'<rootDir>/testHelpers/*',
'<rootDir>/packages/**/__tests__',
],
projects: [
{
...projectDefault,
displayName: 'ACCOUNTS',
testMatch: ['<rootDir>/packages/accounts/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'APPLICATIONS',
testMatch: ['<rootDir>/packages/applications/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'AUDIT',
testMatch: ['<rootDir>/packages/audit/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'AUTH',
testMatch: ['<rootDir>/packages/auth/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'CONVERSATIONS',
testMatch: ['<rootDir>/packages/conversations/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'JWT',
testMatch: ['<rootDir>/packages/jwt/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'MEDIA',
testMatch: ['<rootDir>/packages/media/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'MESSAGES',
testMatch: ['<rootDir>/packages/messages/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'MEETINGS',
testMatch: ['<rootDir>/packages/meetings/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'NUMBER INSIGHT V2',
testMatch: [
'<rootDir>/packages/number-insight-v2/__tests__/**/*.test.ts',
],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'NUMBER INSIGHTS',
testMatch: ['<rootDir>/packages/number-insights/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'NUMBERS',
testMatch: ['<rootDir>/packages/numbers/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'PRICING',
testMatch: ['<rootDir>/packages/pricing/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'PROACTIVE CONNECT',
testMatch: [
'<rootDir>/packages/proactive-connect/__tests__/**/*.test.ts',
],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'REDACT',
testMatch: ['<rootDir>/packages/redact/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'SERVER CLIENT',
testMatch: ['<rootDir>/packages/server-client/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'SERVER SDK',
testMatch: ['<rootDir>/packages/server-sdk/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'SMS',
testMatch: ['<rootDir>/packages/sms/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'SUB ACCOUNTS',
testMatch: ['<rootDir>/packages/subaccounts/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'USER',
testMatch: ['<rootDir>/packages/users/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'VERIFY',
testMatch: ['<rootDir>/packages/verify/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'VERIFY 2',
testMatch: ['<rootDir>/packages/verify2/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'VIDEO',
testMatch: ['<rootDir>/packages/video/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
{
...projectDefault,
displayName: 'VOICE',
testMatch: ['<rootDir>/packages/voice/__tests__/**/*.test.ts'],
coveragePathIgnorePatterns: ['node_modules', '__tests__'],
},
],
moduleNameMapper: {
'@vonage/(.+)': '<rootDir>/packages/$1/lib',
},
};

export default config;
Loading

0 comments on commit 3a0e825

Please sign in to comment.