@@ -678,11 +678,28 @@ test("namespace: detect namespace from pom.xml via ${appId} from properties", as
678678 " couldn't be resolved from maven property \"appId\" of pom.xml of project component.h" ) ;
679679} ) ;
680680
681- test ( "Throw for missing Component.js" , async ( t ) => {
681+ test ( "Throw when neither Component.js nor Component.ts exists " , async ( t ) => {
682682 const { componentHInput} = t . context ;
683683 componentHInput . configuration . resources . configuration . paths . src = "src-no-component" ;
684-
685684 const error = await t . throwsAsync ( Specification . create ( componentHInput ) ) ;
686685 t . is ( error . message ,
687- "Unable to find required file Component.js in component project component.h" ) ;
686+ "Unable to find either required \"Component.js\" or \"Component.ts\" in component project component.h" ) ;
687+ } ) ;
688+
689+ test ( "Do not throw when Component.js exists" , async ( t ) => {
690+ const { componentHInput} = t . context ;
691+ componentHInput . configuration . resources . configuration . paths . src = "src-with-component-js" ;
692+ await t . notThrowsAsync ( Specification . create ( componentHInput ) , "Should not throw an error" ) ;
693+ } ) ;
694+
695+ test ( "Do not throw when Component.ts exists" , async ( t ) => {
696+ const { componentHInput} = t . context ;
697+ componentHInput . configuration . resources . configuration . paths . src = "src-with-component-ts" ;
698+ await t . notThrowsAsync ( Specification . create ( componentHInput ) , "Should not throw an error" ) ;
699+ } ) ;
700+
701+ test ( "Do not throw when both Component.js and Component.ts exist" , async ( t ) => {
702+ const { componentHInput} = t . context ;
703+ componentHInput . configuration . resources . configuration . paths . src = "src-with-component-js-and-component-ts" ;
704+ await t . notThrowsAsync ( Specification . create ( componentHInput ) , "Should not throw an error" ) ;
688705} ) ;
0 commit comments