File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 13
13
"homepage" : " https://github.com/codellm-devkit/typescript-sdk#readme" ,
14
14
"scripts" : {
15
15
"build" : " bun build ./src/index.ts --outdir ./dist" ,
16
- "test" : " bun test --coverage --coverage-reporter=lcov --preload ./test/conftest.ts --timeout=600000 --verbose " ,
16
+ "test" : " bun test --verbose -- coverage --coverage-reporter=lcov --preload ./test/conftest.ts --timeout=600000" ,
17
17
"clean" : " rm -rf dist coverage *.lock"
18
18
},
19
19
"files" : [
Original file line number Diff line number Diff line change @@ -17,15 +17,24 @@ test("Must get Symbol Table", async () => {
17
17
} ) ;
18
18
19
19
test ( "Must get all classes in a Java application" , async ( ) => {
20
- expect ( await daytraderJavaAnalysis . getAllClasses ( ) ) . toBeDefined ( ) ;
20
+ await expect ( daytraderJavaAnalysis . getAllClasses ( ) ) . toBeDefined ( ) ;
21
21
} ) ;
22
22
23
23
test ( "Must get a specific class the application" , async ( ) => {
24
24
const tradeDirectObject = await daytraderJavaAnalysis . getClassByQualifiedName ( "com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect" ) ;
25
- console . log ( tradeDirectObject ) ;
26
25
expect ( async ( ) => JType . parse ( tradeDirectObject ) ) . not . toThrow ( ) ;
27
26
} ) ;
28
27
28
+ test ( "Must throw error when a requested class in the application does not exist" , async ( ) => {
29
+ /**
30
+ * Quick note to self: There is a subtle difference between await expect(...) and expect(await ...)
31
+ * When there is an error, the reject happens even before the expect can be honored. So instead, we await the expect
32
+ * by saying "Hey, I expect this promise to be rejected with this error ..."
33
+ */
34
+ await expect ( daytraderJavaAnalysis . getClassByQualifiedName ( "this.class.does.not.Exist" ) ) . rejects . toThrow (
35
+ "Class this.class.does.not.Exist not found in the application." ) ;
36
+ } ) ;
37
+
29
38
test ( "Must get all methods in the application" , ( ) => {
30
39
return daytraderJavaAnalysis . getAllMethods ( ) . then ( ( methods ) => {
31
40
expect ( methods ) . toBeDefined ( )
You can’t perform that action at this time.
0 commit comments