Skip to content

Commit

Permalink
Merge pull request #6 from AI21Labs/add_chat_completions_tests
Browse files Browse the repository at this point in the history
ci: Add chat completions tests
  • Loading branch information
Josephasafg authored Nov 12, 2024
2 parents 2467332 + ebd5d97 commit e185809
Show file tree
Hide file tree
Showing 13 changed files with 8,666 additions and 2,648 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/quality-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3.2.0

- name: Use Node.js 20.18.0
uses: actions/setup-node@v4
with:
fetch-depth: 0
- name: Pre-commit
uses: pre-commit/action@v3.0.0
with:
extra_args: --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
# - name: CODEOWNERS validator
# uses: mszostok/codeowners-validator@v0.6.0
# with:
# checks: files,duppatterns,syntax,owners
# experimental_checks: notowned
# github_access_token: ${{ secrets.GH_PAT_RO }}
node-version: 20.18.0
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Run quality checks
run: npm run quality


27 changes: 27 additions & 0 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Unittest

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Run tests
run: npm run test

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,4 @@ dist/
node_modules/
.cursorrules
.vscode/
coverage/
35 changes: 35 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import type { Config } from '@jest/types';

const config: Config.InitialOptions = {
displayName: {
name: 'ai21-typescript',
color: 'blue',
},
coverageThreshold: {
global: {
branches: 0,
functions: 0,
lines: 0,
},
},
roots: ['<rootDir>'],
testEnvironment: 'jsdom',
testMatch: ['**/tests/**/?(*.)+(spec|test).+(ts|tsx|js)', '**/src/**/?(*.)+(spec|test).+(ts|tsx|js)'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
testEnvironmentOptions: {
customExportConditions: [''],
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^@icons(.*)$': `<rootdir>/src/assets/icons/$1`,
'^@components(.*)$': `<rootdir>/src/components/$1`,
'^@services(.*)$': `<rootdir>/src/services/$1`,
'^@utils(.*)$': `<rootdir>/src/utils/$1`,
'^@types(.*)$': `<rootdir>/src/types/$1`,
uuid: require.resolve('uuid'),
},
};

export default config;
Loading

0 comments on commit e185809

Please sign in to comment.