File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5252 env :
5353 CLUSTER_ENDPOINT : ${{ secrets.TYPESCRIPT_SEQUELIZE_CLUSTER_ENDPOINT}}
5454 REGION : ${{ secrets.TYPESCRIPT_SEQUELIZE_CLUSTER_REGION}}
55+ CLUSTER_USER : ' admin'
5556 run : |
5657 npm install
5758 npm run test
Original file line number Diff line number Diff line change 33 "version" : " 1.0.0" ,
44 "description" : " How To" ,
55 "main" : " index.js" ,
6- "type" : " module " ,
6+ "type" : " commonjs " ,
77 "scripts" : {
88 "build" : " tsc" ,
9- "start" : " node dist/index.js" ,
10- "dev" : " npm run build && npm run start"
9+ "clean" : " rm -rf build && rm -rf dist" ,
10+ "start" : " node dist/src/index.js" ,
11+ "dev" : " npm run clean && npm run build && npm run start" ,
12+ "test" : " npm run clean && npm run build && jest dist/test"
1113 },
1214 "dependencies" : {
1315 "@aws-sdk/dsql-signer" : " ^3.705.0" ,
1719 "sequelize" : " ^6.37.5"
1820 },
1921 "devDependencies" : {
22+ "@types/jest" : " ^29.5.14" ,
23+ "jest" : " ^29.7.0" ,
2024 "typescript" : " ^5.0.0"
2125 }
2226}
Original file line number Diff line number Diff line change @@ -308,9 +308,11 @@ async function retryExample() {
308308 await sequelize . close ( ) ;
309309}
310310
311- async function runExamples ( ) {
311+ export async function runExamples ( ) {
312312 await sequelizeExample ( ) ;
313313 await retryExample ( ) ;
314314}
315315
316- runExamples ( )
316+ if ( require . main === module ) {
317+ runExamples ( ) . catch ( console . error ) ;
318+ }
Original file line number Diff line number Diff line change 1+ import { runExamples } from "../src/index.js"
2+
3+ const SECONDS = 1000 ;
4+
5+ describe ( "Index module" , ( ) => {
6+ test ( "Runs all the example code" , async ( ) => {
7+ await runExamples ( ) ;
8+ } , 60 * SECONDS )
9+ } )
Original file line number Diff line number Diff line change 11{
22 "compilerOptions" : {
3- "target" : " es2016 " ,
4- "module" : " ES2020 " ,
5- "moduleResolution" : " node " ,
3+ "target" : " ES6 " ,
4+ "module" : " node16 " ,
5+ "moduleResolution" : " node16 " ,
66 "forceConsistentCasingInFileNames" : true ,
77 "strict" : true ,
88 "skipLibCheck" : true ,
9- "outDir" : " ./dist" ,
10- "rootDir" : " ./src" ,
9+ "outDir" : " dist" ,
1110 },
12- "include" : [" src/**/*" ]
11+ "include" : [" src/**/*" , " test/**/* " ]
1312}
You can’t perform that action at this time.
0 commit comments