@@ -1963,6 +1963,44 @@ publish("name", {type: "${fromType}", schema: "schemaOverride"}).type("${toType}
19631963 expect ( result . compile . compiledGraph . targets ?. map ( t => t . name ) ) . deep . equals ( [ "sample-action" ] ) ;
19641964 } ) ;
19651965
1966+ test ( "works in application mode without workflow settings" , ( ) => {
1967+ const projectDir = tmpDirFixture . createNewTmpDir ( ) ;
1968+ fs . mkdirSync ( path . join ( projectDir , "definitions" ) ) ;
1969+ fs . writeFileSync ( path . join ( projectDir , "definitions/e.sqlx" ) , `config {type: "view"}` ) ;
1970+ fs . writeFileSync ( path . join ( projectDir , "definitions/file.sqlx" ) , "${resolve('e')}" ) ;
1971+
1972+ const request = coreExecutionRequestFromPath ( projectDir ) ;
1973+ request . compile . compileConfig . extension = {
1974+ name : "@dataform/sample-extension" ,
1975+ compilationMode : dataform . ExtensionCompilationMode . APPLICATION_CODE
1976+ } ;
1977+
1978+ const result = runMainInVm ( request ) ;
1979+
1980+ expect ( result . compile . compiledGraph . graphErrors . compilationErrors ) . deep . equals ( [ ] ) ;
1981+ expect ( result . compile . compiledGraph . targets ?. map ( t => t . name ) ) . deep . equals ( [
1982+ "sample-action"
1983+ ] ) ;
1984+ } ) ;
1985+
1986+ test ( "works in prologue mode without workflow settings" , ( ) => {
1987+ const projectDir = tmpDirFixture . createNewTmpDir ( ) ;
1988+ fs . mkdirSync ( path . join ( projectDir , "definitions" ) ) ;
1989+ fs . writeFileSync ( path . join ( projectDir , "definitions/e.sqlx" ) , `config {type: "view"}` ) ;
1990+ fs . writeFileSync ( path . join ( projectDir , "definitions/file.sqlx" ) , "${resolve('e')}" ) ;
1991+
1992+ const request = coreExecutionRequestFromPath ( projectDir ) ;
1993+ request . compile . compileConfig . extension = {
1994+ name : "@dataform/sample-extension" ,
1995+ compilationMode : dataform . ExtensionCompilationMode . PROLOGUE ,
1996+ } ;
1997+
1998+ const result = runMainInVm ( request ) ;
1999+
2000+ expect ( result . compile . compiledGraph . graphErrors . compilationErrors ) . deep . equals ( [ ] ) ;
2001+ expect ( result . compile . compiledGraph . targets ?. map ( t => t . name ) ) . deep . equals ( [ "sample-action" , "e" , "file" ] ) ;
2002+ } ) ;
2003+
19662004 test ( "catches extension import exceptions" , ( ) => {
19672005 const projectDir = setUpProjectWithExtension ( ) ;
19682006 const request = coreExecutionRequestFromPath ( projectDir ) ;
0 commit comments