@@ -12,9 +12,11 @@ import { describeServeBuilder } from '../jasmine-helpers';
1212import { BASE_OPTIONS , DEV_SERVER_BUILDER_INFO } from '../setup' ;
1313
1414describeServeBuilder ( executeDevServer , DEV_SERVER_BUILDER_INFO , ( harness , setupTarget ) => {
15+ const javascriptFileContent =
16+ "import {foo} from 'unresolved'; /* a comment */const foo = `bar`;\n\n\n" ;
17+
1518 describe ( 'Behavior: "browser builder assets"' , ( ) => {
1619 it ( 'serves a project JavaScript asset unmodified' , async ( ) => {
17- const javascriptFileContent = '/* a comment */const foo = `bar`;\n\n\n' ;
1820 await harness . writeFile ( 'src/extra.js' , javascriptFileContent ) ;
1921
2022 setupTarget ( harness , {
@@ -33,5 +35,25 @@ describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupT
3335 expect ( result ?. success ) . toBeTrue ( ) ;
3436 expect ( await response ?. text ( ) ) . toBe ( javascriptFileContent ) ;
3537 } ) ;
38+
39+ it ( 'serves a project TypeScript asset unmodified' , async ( ) => {
40+ await harness . writeFile ( 'src/extra.ts' , javascriptFileContent ) ;
41+
42+ setupTarget ( harness , {
43+ assets : [ 'src/extra.ts' ] ,
44+ optimization : {
45+ scripts : true ,
46+ } ,
47+ } ) ;
48+
49+ harness . useTarget ( 'serve' , {
50+ ...BASE_OPTIONS ,
51+ } ) ;
52+
53+ const { result, response } = await executeOnceAndFetch ( harness , 'extra.ts' ) ;
54+
55+ expect ( result ?. success ) . toBeTrue ( ) ;
56+ expect ( await response ?. text ( ) ) . toContain ( javascriptFileContent ) ;
57+ } ) ;
3658 } ) ;
3759} ) ;
0 commit comments