@@ -12,9 +12,11 @@ import { describeServeBuilder } from '../jasmine-helpers';
12
12
import { BASE_OPTIONS , DEV_SERVER_BUILDER_INFO } from '../setup' ;
13
13
14
14
describeServeBuilder ( executeDevServer , DEV_SERVER_BUILDER_INFO , ( harness , setupTarget ) => {
15
+ const javascriptFileContent =
16
+ "import {foo} from 'unresolved'; /* a comment */const foo = `bar`;\n\n\n" ;
17
+
15
18
describe ( 'Behavior: "browser builder assets"' , ( ) => {
16
19
it ( 'serves a project JavaScript asset unmodified' , async ( ) => {
17
- const javascriptFileContent = '/* a comment */const foo = `bar`;\n\n\n' ;
18
20
await harness . writeFile ( 'src/extra.js' , javascriptFileContent ) ;
19
21
20
22
setupTarget ( harness , {
@@ -33,5 +35,25 @@ describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupT
33
35
expect ( result ?. success ) . toBeTrue ( ) ;
34
36
expect ( await response ?. text ( ) ) . toContain ( javascriptFileContent ) ;
35
37
} ) ;
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
+ } ) ;
36
58
} ) ;
37
59
} ) ;
0 commit comments