Skip to content

Commit

Permalink
chore: add unit test automation
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 592614153
  • Loading branch information
sararob authored and copybara-github committed Dec 21, 2023
1 parent de477ce commit a2ca50f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/presubmit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on:
pull_request:
name: presubmit
jobs:
units:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18, 20]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: ^6.24.1
- run: node --version
- run: npm run test
name: Run unit tests
env:
BUILD_TYPE: presubmit
TEST_TYPE: units
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"docs-test": "linkinator docs",
"compile:oss": "tsc -p tsconfig.json.oss",
"fix": "gts fix",
"test": "TODO",
"test": "jasmine build/src/index_test.js",
"system-test": "jasmine build/system_test/*.js",
"lint": "gts lint",
"clean-js-files": "find . -type f -name \"*.js\" -exec rm -f {} +",
Expand All @@ -36,9 +36,9 @@
},
"devDependencies": {
"@types/jasmine": "^5.1.2",
"jasmine": "^5.1.0",
"@types/node": "^20.9.0",
"gts": "^5.2.0",
"jasmine": "^5.1.0",
"typescript": "~5.2.0",
"jsdoc": "^4.0.0",
"jsdoc-fresh": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/index_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

/* tslint:disable */
import 'jasmine';
// import 'jasmine';

import {ChatSession, GenerativeModel, StartChatParams, VertexAI} from './index';
import * as StreamFunctions from './process_stream';
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
},
"include": [
"src/*.ts",
"src/*.d.ts",
"src/**/*.ts",
"test/*.ts",
"test/**/*.ts",
"src/**/*.js",
"src/**/*.json",
"system_test/*.ts"
]
}

0 comments on commit a2ca50f

Please sign in to comment.