@@ -2,32 +2,39 @@ import assert from "yeoman-assert"
2
2
import path from "path"
3
3
4
4
export const testCases = [
5
- {
6
- platform : "Static webserver" ,
7
- enableFPM : true ,
8
- serviceUrl : "http://localhost:4004/travel" ,
9
- mainEntity : "BookedFlights" ,
10
- enableTypescript : false
11
- } ,
12
- {
13
- platform : "Application Router" ,
14
- enableFPM : true ,
15
- serviceUrl : "http://localhost:4004/travel" ,
16
- mainEntity : "BookedFlights" ,
17
- enableTypescript : true ,
18
- newDir : false
19
- } ,
20
- {
21
- platform : "SAP HTML5 Application Repository Service" ,
22
- enableFPM : true ,
23
- serviceUrl : "http://localhost:4004/travel" ,
24
- mainEntity : "BookedFlights" ,
25
- enableTypescript : true
26
- } ,
5
+ // {
6
+ // platform: "Static webserver",
7
+ // enableFPM: true,
8
+ // serviceUrl: "http://localhost:4004/travel",
9
+ // mainEntity: "BookedFlights",
10
+ // enableTypescript: false
11
+ // },
12
+ // {
13
+ // platform: "Application Router",
14
+ // enableFPM: true,
15
+ // serviceUrl: "http://localhost:4004/travel",
16
+ // mainEntity: "BookedFlights",
17
+ // enableTypescript: true,
18
+ // newDir: false
19
+ // },
20
+ // {
21
+ // platform: "SAP HTML5 Application Repository Service",
22
+ // enableFPM: true,
23
+ // serviceUrl: "http://localhost:4004/travel",
24
+ // mainEntity: "BookedFlights",
25
+ // enableTypescript: true
26
+ // },
27
+ // {
28
+ // platform: "SAP Build Work Zone, standard edition",
29
+ // enableFPM: true,
30
+ // serviceUrl: "http://localhost:4004/travel",
31
+ // mainEntity: "BookedFlights",
32
+ // enableTypescript: true
33
+ // },
27
34
{
28
35
platform : "SAP Build Work Zone, standard edition" ,
29
36
enableFPM : true ,
30
- serviceUrl : "http://localhost:4004/travel" ,
37
+ serviceIsReady : false ,
31
38
mainEntity : "BookedFlights" ,
32
39
enableTypescript : true
33
40
} ,
@@ -65,54 +72,59 @@ export const tests = (testCase, uimodulePath) => {
65
72
path . join ( uimodulePath , "ui5.yaml" ) ,
66
73
"SAPUI5"
67
74
)
68
- assert . fileContent (
69
- path . join ( uimodulePath , "ui5-mock.yaml" ) ,
70
- "SAPUI5"
71
- )
75
+ if ( testCase . serviceIsReady ) {
76
+ assert . fileContent (
77
+ path . join ( uimodulePath , "ui5-mock.yaml" ) ,
78
+ "SAPUI5"
79
+ )
80
+ }
72
81
73
82
// don't proxy resources/ to CDN unless its needed for flpSandbox.html (via preview-middleware)
74
83
if ( testCase . platform !== "SAP Build Work Zone, standard edition" ) {
75
84
assert . noFileContent (
76
85
path . join ( uimodulePath , "ui5.yaml" ) ,
77
86
"https://ui5.sap.com"
78
87
)
79
- assert . noFileContent (
80
- path . join ( uimodulePath , "ui5-mock.yaml" ) ,
81
- "https://ui5.sap.com"
82
- )
83
-
88
+ if ( testCase . serviceIsReady ) {
89
+ assert . noFileContent (
90
+ path . join ( uimodulePath , "ui5-mock.yaml" ) ,
91
+ "https://ui5.sap.com"
92
+ )
93
+ }
84
94
}
85
95
} )
86
96
87
- it ( "should use sap-fe-mockserver properly" , async function ( ) {
88
- assert . noFileContent (
89
- path . join ( uimodulePath , "ui5.yaml" ) ,
90
- "sap-fe-mockserver"
91
- )
92
- assert . fileContent (
93
- path . join ( uimodulePath , "ui5-mock.yaml" ) ,
94
- "sap-fe-mockserver"
95
- )
96
- } )
97
+ if ( testCase . serviceIsReady ) {
98
+ it ( "should use sap-fe-mockserver properly" , async function ( ) {
99
+ assert . noFileContent (
100
+ path . join ( uimodulePath , "ui5.yaml" ) ,
101
+ "sap-fe-mockserver"
102
+ )
103
+ assert . fileContent (
104
+ path . join ( uimodulePath , "ui5-mock.yaml" ) ,
105
+ "sap-fe-mockserver"
106
+ )
107
+ } )
97
108
98
- it ( "should set up a proxy to service url" , async function ( ) {
99
- assert . fileContent (
100
- path . join ( uimodulePath , "ui5.yaml" ) ,
101
- "fiori-tools-proxy"
102
- )
103
- assert . fileContent (
104
- path . join ( uimodulePath , "ui5.yaml" ) ,
105
- new URL ( testCase . serviceUrl ) . origin
106
- )
107
- assert . fileContent (
108
- path . join ( uimodulePath , "ui5-mock.yaml" ) ,
109
- new URL ( testCase . serviceUrl ) . origin
110
- )
111
- } )
109
+ it ( "should generate annotation file" , async function ( ) {
110
+ assert . file ( path . join ( uimodulePath , "webapp/annotations/annotation.xml" ) )
111
+ } )
112
112
113
- it ( "should generate annotation file" , async function ( ) {
114
- assert . file ( path . join ( uimodulePath , "webapp/annotations/annotation.xml" ) )
115
- } )
113
+ it ( "should set up a proxy to service url" , async function ( ) {
114
+ assert . fileContent (
115
+ path . join ( uimodulePath , "ui5.yaml" ) ,
116
+ "fiori-tools-proxy"
117
+ )
118
+ assert . fileContent (
119
+ path . join ( uimodulePath , "ui5.yaml" ) ,
120
+ new URL ( testCase . serviceUrl ) . origin
121
+ )
122
+ assert . fileContent (
123
+ path . join ( uimodulePath , "ui5-mock.yaml" ) ,
124
+ new URL ( testCase . serviceUrl ) . origin
125
+ )
126
+ } )
127
+ }
116
128
117
129
it ( "should use Fiori elements components" , async function ( ) {
118
130
assert . fileContent (
0 commit comments