Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added unit test for npm and github ci #25

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: Test npm package

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

jobs:
build-and-test:
name: Build and Test @infrastack/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
Loading