Skip to content

Commit

Permalink
Unit test for npm otel package and relative CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ferhatkorkmaz11 committed Oct 7, 2024
1 parent 0dcabd5 commit e461eda
Show file tree
Hide file tree
Showing 5 changed files with 6,252 additions and 2,623 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/test-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI for otel Package

on:
pull_request:
branches:
- main
paths:
- 'packages/javascript/otel/**'

jobs:
build-and-test:
name: Build and Test otel Package
runs-on: ubuntu-latest

defaults:
run:
working-directory: packages/javascript/otel

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: packages/javascript/otel/package-lock.json

- name: Install dependencies
run: npm install

- name: Run Lint
run: npm run lint

- name: Build the package
run: npm run build

- name: Run Tests
env:
INFRASTACK_TAGS: '[{"key": "env", "value": "test"}]'
run: npm run test
10 changes: 10 additions & 0 deletions packages/javascript/otel/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json',
},
},
modulePathIgnorePatterns: ['dist'],
};
Loading

0 comments on commit e461eda

Please sign in to comment.