@@ -12,6 +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+ beforeEach ( async ( ) => {
16+ // Application code is not needed for these tests
17+ await harness . writeFile ( 'src/main.ts' , 'console.log("TEST");' ) ;
18+ } ) ;
19+
1520 const javascriptFileContent =
1621 "import {foo} from 'unresolved'; /* a comment */const foo = `bar`;\n\n\n" ;
1722
@@ -53,6 +58,42 @@ describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupT
5358 expect ( await response ?. text ( ) ) . toContain ( javascriptFileContent ) ;
5459 } ) ;
5560
61+ it ( 'serves a project CSS asset unmodified' , async ( ) => {
62+ const cssFileContent = 'p { color: blue };' ;
63+ await harness . writeFile ( 'src/extra.css' , cssFileContent ) ;
64+
65+ setupTarget ( harness , {
66+ assets : [ 'src/extra.css' ] ,
67+ } ) ;
68+
69+ harness . useTarget ( 'serve' , {
70+ ...BASE_OPTIONS ,
71+ } ) ;
72+
73+ const { result, response } = await executeOnceAndFetch ( harness , 'extra.css' ) ;
74+
75+ expect ( result ?. success ) . toBeTrue ( ) ;
76+ expect ( await response ?. text ( ) ) . toBe ( cssFileContent ) ;
77+ } ) ;
78+
79+ it ( 'serves a project SCSS asset unmodified' , async ( ) => {
80+ const cssFileContent = 'p { color: blue };' ;
81+ await harness . writeFile ( 'src/extra.scss' , cssFileContent ) ;
82+
83+ setupTarget ( harness , {
84+ assets : [ 'src/extra.scss' ] ,
85+ } ) ;
86+
87+ harness . useTarget ( 'serve' , {
88+ ...BASE_OPTIONS ,
89+ } ) ;
90+
91+ const { result, response } = await executeOnceAndFetch ( harness , 'extra.scss' ) ;
92+
93+ expect ( result ?. success ) . toBeTrue ( ) ;
94+ expect ( await response ?. text ( ) ) . toBe ( cssFileContent ) ;
95+ } ) ;
96+
5697 it ( 'should return 404 for non existing assets' , async ( ) => {
5798 setupTarget ( harness , {
5899 assets : [ ] ,
0 commit comments