Skip to content

Commit

Permalink
Merge pull request #5 from awslabs/unit-tests
Browse files Browse the repository at this point in the history
Unit tests
  • Loading branch information
brnaba-aws authored Jul 26, 2024
2 parents 6a65c08 + d07902f commit 5f93beb
Show file tree
Hide file tree
Showing 13 changed files with 860 additions and 348 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-security-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
# Checkout and setup.
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
- name: Install dependencies
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Run tests on the project

on:
push:
branches:
- main
pull_request:
types:
- opened
- edited


permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Link Checker
uses: lycheeverse/lychee-action@c053181aa0c3d17606addfe97a9075a32723548a
with:
fail: true
args: --scheme=https . --exclude-all-private
- name: Install dependencies
run: npm install
- name: Run tests
run: npm run coverage
# - name: Spell check
# uses: streetsidesoftware/cspell-action@4dc9d4bdf3974ed26d6f2e973c1e168edff47d80
# with:
# files: '**/*.{md,ts}'
# strict: true
# check_dot_files: true
# incremental_files_only: false
# config: 'cspell.config.yml'
# - name: Run ShellCheck
# uses: ludeeus/action-shellcheck@cd81f4475ab741e097ec0fe73b692f3e49d66b8c
# with:
# scandir: '.'
# ignore_paths: >-
# node_modules
# .husky
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^7.17.0",
"@typescript-eslint/parser": "^7.17.0",
"aws-sdk-client-mock": "^4.0.1",
"aws-sdk-client-mock-jest": "^4.0.1",
"eslint": "^8.57.0",
"jest": "^29.7.0",
"ts-jest": "^29.2.2",
"ts-jest": "^29.2.3",
"ts-node": "^10.9.2",
"typescript": "^5.5.3"
}
Expand Down
2 changes: 1 addition & 1 deletion src/agents/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export abstract class Agent {
private generateKeyFromName(name: string): string {
// Remove special characters and replace spaces with hyphens
const key = name
.replace(/[^a-zA-Z\s]/g, "")
.replace(/[^a-zA-Z\s-]/g, "")
.replace(/\s+/g, "-")
.toLowerCase();
return key;
Expand Down
181 changes: 0 additions & 181 deletions tests/Classifier.test.ts

This file was deleted.

Loading

0 comments on commit 5f93beb

Please sign in to comment.