Skip to content

Commit 223aeb1

Browse files
committed
test(project): Update various tests
1 parent 2837596 commit 223aeb1

12 files changed

Lines changed: 106 additions & 62 deletions

File tree

packages/project/lib/build/ProjectBuilder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ class ProjectBuilder {
468468
default: createBuildManifest
469469
} = await import("./helpers/createBuildManifest.js");
470470
const buildManifest = await createBuildManifest(
471-
project, this._graph, buildConfig, this._buildContext.getTaskRepository(),
471+
project, buildConfig, this._buildContext.getTaskRepository(),
472472
projectBuildContext.getBuildSignature());
473473
await target.write(resourceFactory.createResource({
474474
path: `/.ui5/build-manifest.json`,

packages/project/lib/build/helpers/BuildContext.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class BuildContext {
1717
cssVariables = false,
1818
jsdoc = false,
1919
createBuildManifest = false,
20-
useCache = false,
2120
outputStyle = OutputStyleEnum.Default,
2221
includedTasks = [], excludedTasks = [],
2322
} = {}) {
@@ -72,7 +71,6 @@ class BuildContext {
7271
outputStyle,
7372
includedTasks,
7473
excludedTasks,
75-
useCache,
7674
};
7775
this._buildSignatureBase = getBaseSignature(this._buildConfig);
7876

packages/project/lib/build/helpers/createBuildManifest.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ function getSortedTags(project) {
1616
return Object.fromEntries(entities);
1717
}
1818

19-
export default async function(project, graph, buildConfig, taskRepository, signature) {
19+
export default async function(project, buildConfig, taskRepository, signature) {
2020
if (!project) {
2121
throw new Error(`Missing parameter 'project'`);
2222
}
23-
if (!graph) {
24-
throw new Error(`Missing parameter 'graph'`);
25-
}
2623
if (!buildConfig) {
2724
throw new Error(`Missing parameter 'buildConfig'`);
2825
}
2926
if (!taskRepository) {
3027
throw new Error(`Missing parameter 'taskRepository'`);
3128
}
29+
if (!signature) {
30+
throw new Error(`Missing parameter 'signature'`);
31+
}
3232

3333
const projectName = project.getName();
3434
const type = project.getType();

packages/project/test/lib/build/ProjectBuilder.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -585,21 +585,18 @@ test.serial("_writeResults: Create build manifest", async (t) => {
585585
t.is(createBuildManifestStub.callCount, 1, "createBuildManifest got called once");
586586
t.is(createBuildManifestStub.getCall(0).args[0], mockProject,
587587
"createBuildManifest got called with correct project");
588-
t.is(createBuildManifestStub.getCall(0).args[1], graph,
589-
"createBuildManifest got called with correct graph");
590-
t.deepEqual(createBuildManifestStub.getCall(0).args[2], {
588+
t.deepEqual(createBuildManifestStub.getCall(0).args[1], {
591589
createBuildManifest: true,
592590
outputStyle: OutputStyleEnum.Default,
593591
cssVariables: false,
594592
excludedTasks: [],
595593
includedTasks: [],
596594
jsdoc: false,
597595
selfContained: false,
598-
useCache: false,
599596
}, "createBuildManifest got called with correct build configuration");
600-
t.is(createBuildManifestStub.getCall(0).args[3], taskRepository,
597+
t.is(createBuildManifestStub.getCall(0).args[2], taskRepository,
601598
"createBuildManifest got called with correct taskRepository");
602-
t.is(createBuildManifestStub.getCall(0).args[4], "build-signature",
599+
t.is(createBuildManifestStub.getCall(0).args[3], "build-signature",
603600
"createBuildManifest got called with correct buildSignature");
604601

605602
t.is(createResourceStub.callCount, 1, "One resource has been created");

packages/project/test/lib/build/definitions/application.js

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,23 @@ test("Standard build", (t) => {
5757
replaceCopyright: {
5858
options: {
5959
copyright: "copyright", pattern: "/**/*.{js,json}"
60-
}
60+
},
61+
supportsDifferentialUpdates: true,
6162
},
6263
replaceVersion: {
6364
options: {
6465
version: "version", pattern: "/**/*.{js,json}"
65-
}
66+
},
67+
supportsDifferentialUpdates: true,
6668
},
6769
minify: {
6870
options: {
6971
pattern: [
7072
"/**/*.js",
7173
"!**/*.support.js",
7274
]
73-
}
75+
},
76+
supportsDifferentialUpdates: true,
7477
},
7578
enhanceManifest: {},
7679
generateFlexChangesBundle: {},
@@ -137,20 +140,23 @@ test("Standard build with legacy spec version", (t) => {
137140
replaceCopyright: {
138141
options: {
139142
copyright: "copyright", pattern: "/**/*.{js,json}"
140-
}
143+
},
144+
supportsDifferentialUpdates: true,
141145
},
142146
replaceVersion: {
143147
options: {
144148
version: "version", pattern: "/**/*.{js,json}"
145-
}
149+
},
150+
supportsDifferentialUpdates: true,
146151
},
147152
minify: {
148153
options: {
149154
pattern: [
150155
"/**/*.js",
151156
"!**/*.support.js",
152157
]
153-
}
158+
},
159+
supportsDifferentialUpdates: true,
154160
},
155161
enhanceManifest: {},
156162
generateFlexChangesBundle: {},
@@ -250,20 +256,23 @@ test("Custom bundles", async (t) => {
250256
replaceCopyright: {
251257
options: {
252258
copyright: "copyright", pattern: "/**/*.{js,json}"
253-
}
259+
},
260+
supportsDifferentialUpdates: true,
254261
},
255262
replaceVersion: {
256263
options: {
257264
version: "version", pattern: "/**/*.{js,json}"
258-
}
265+
},
266+
supportsDifferentialUpdates: true,
259267
},
260268
minify: {
261269
options: {
262270
pattern: [
263271
"/**/*.js",
264272
"!**/*.support.js",
265273
]
266-
}
274+
},
275+
supportsDifferentialUpdates: true,
267276
},
268277
enhanceManifest: {},
269278
generateFlexChangesBundle: {},
@@ -396,7 +405,8 @@ test("Minification excludes", (t) => {
396405
"!**/*.support.js",
397406
"!/resources/**.html",
398407
]
399-
}
408+
},
409+
supportsDifferentialUpdates: true,
400410
}, "Correct minify task definition");
401411
});
402412

@@ -421,7 +431,8 @@ test("Minification excludes not applied for legacy specVersion", (t) => {
421431
"/**/*.js",
422432
"!**/*.support.js",
423433
]
424-
}
434+
},
435+
supportsDifferentialUpdates: true,
425436
}, "Correct minify task definition");
426437
});
427438

packages/project/test/lib/build/definitions/component.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,23 @@ test("Standard build", (t) => {
5656
replaceCopyright: {
5757
options: {
5858
copyright: "copyright", pattern: "/**/*.{js,json}"
59-
}
59+
},
60+
supportsDifferentialUpdates: true,
6061
},
6162
replaceVersion: {
6263
options: {
6364
version: "version", pattern: "/**/*.{js,json}"
64-
}
65+
},
66+
supportsDifferentialUpdates: true,
6567
},
6668
minify: {
6769
options: {
6870
pattern: [
6971
"/**/*.js",
7072
"!**/*.support.js",
7173
]
72-
}
74+
},
75+
supportsDifferentialUpdates: true,
7376
},
7477
enhanceManifest: {},
7578
generateFlexChangesBundle: {},
@@ -162,20 +165,23 @@ test("Custom bundles", async (t) => {
162165
replaceCopyright: {
163166
options: {
164167
copyright: "copyright", pattern: "/**/*.{js,json}"
165-
}
168+
},
169+
supportsDifferentialUpdates: true,
166170
},
167171
replaceVersion: {
168172
options: {
169173
version: "version", pattern: "/**/*.{js,json}"
170-
}
174+
},
175+
supportsDifferentialUpdates: true,
171176
},
172177
minify: {
173178
options: {
174179
pattern: [
175180
"/**/*.js",
176181
"!**/*.support.js",
177182
]
178-
}
183+
},
184+
supportsDifferentialUpdates: true,
179185
},
180186
enhanceManifest: {},
181187
generateFlexChangesBundle: {},
@@ -301,7 +307,8 @@ test("Minification excludes", (t) => {
301307
"!**/*.support.js",
302308
"!/resources/**.html",
303309
]
304-
}
310+
},
311+
supportsDifferentialUpdates: true,
305312
}, "Correct minify task definition");
306313
});
307314

packages/project/test/lib/build/definitions/library.js

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,14 @@ test("Standard build", async (t) => {
7474
options: {
7575
version: "version",
7676
pattern: "/**/*.{js,json,library,css,less,theme,html}"
77-
}
77+
},
78+
supportsDifferentialUpdates: true,
7879
},
7980
replaceBuildtime: {
8081
options: {
8182
pattern: "/resources/sap/ui/{Global,core/Core}.js"
82-
}
83+
},
84+
supportsDifferentialUpdates: true,
8385
},
8486
generateJsdoc: {
8587
requiresDependencies: true,
@@ -98,6 +100,7 @@ test("Standard build", async (t) => {
98100
"!**/*.support.js",
99101
]
100102
}
103+
supportsDifferentialUpdates: true,
101104
},
102105
generateLibraryManifest: {},
103106
enhanceManifest: {},
@@ -211,12 +214,14 @@ test("Standard build with legacy spec version", (t) => {
211214
options: {
212215
version: "version",
213216
pattern: "/**/*.{js,json,library,css,less,theme,html}"
214-
}
217+
},
218+
supportsDifferentialUpdates: true,
215219
},
216220
replaceBuildtime: {
217221
options: {
218222
pattern: "/resources/sap/ui/{Global,core/Core}.js"
219-
}
223+
},
224+
supportsDifferentialUpdates: true,
220225
},
221226
generateJsdoc: {
222227
requiresDependencies: true,
@@ -235,6 +240,7 @@ test("Standard build with legacy spec version", (t) => {
235240
"!**/*.support.js",
236241
]
237242
}
243+
supportsDifferentialUpdates: true,
238244
},
239245
generateLibraryManifest: {},
240246
enhanceManifest: {},
@@ -337,12 +343,14 @@ test("Custom bundles", async (t) => {
337343
options: {
338344
version: "version",
339345
pattern: "/**/*.{js,json,library,css,less,theme,html}"
340-
}
346+
},
347+
supportsDifferentialUpdates: true,
341348
},
342349
replaceBuildtime: {
343350
options: {
344351
pattern: "/resources/sap/ui/{Global,core/Core}.js"
345-
}
352+
},
353+
supportsDifferentialUpdates: true,
346354
},
347355
generateJsdoc: {
348356
requiresDependencies: true,
@@ -361,6 +369,7 @@ test("Custom bundles", async (t) => {
361369
"!**/*.support.js",
362370
]
363371
}
372+
supportsDifferentialUpdates: true,
364373
},
365374
generateLibraryManifest: {},
366375
enhanceManifest: {},
@@ -489,7 +498,8 @@ test("Minification excludes", (t) => {
489498
"!**/*.support.js",
490499
"!/resources/**.html",
491500
]
492-
}
501+
},
502+
supportsDifferentialUpdates: true,
493503
}, "Correct minify task definition");
494504
});
495505

@@ -514,7 +524,8 @@ test("Minification excludes not applied for legacy specVersion", (t) => {
514524
"/resources/**/*.js",
515525
"!**/*.support.js",
516526
]
517-
}
527+
},
528+
supportsDifferentialUpdates: true,
518529
}, "Correct minify task definition");
519530
});
520531

@@ -681,12 +692,14 @@ test("Standard build: nulled taskFunction to skip tasks", (t) => {
681692
options: {
682693
version: "version",
683694
pattern: "/**/*.{js,json,library,css,less,theme,html}"
684-
}
695+
},
696+
supportsDifferentialUpdates: true,
685697
},
686698
replaceBuildtime: {
687699
options: {
688700
pattern: "/resources/sap/ui/{Global,core/Core}.js"
689-
}
701+
},
702+
supportsDifferentialUpdates: true,
690703
},
691704
generateJsdoc: {
692705
requiresDependencies: true,
@@ -705,6 +718,7 @@ test("Standard build: nulled taskFunction to skip tasks", (t) => {
705718
"!**/*.support.js",
706719
]
707720
}
721+
supportsDifferentialUpdates: true,
708722
},
709723
generateLibraryManifest: {},
710724
enhanceManifest: {},

packages/project/test/lib/build/definitions/themeLibrary.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,15 @@ test("Standard build", (t) => {
5353
options: {
5454
copyright: "copyright",
5555
pattern: "/resources/**/*.{less,theme}"
56-
}
56+
},
57+
supportsDifferentialUpdates: true,
5758
},
5859
replaceVersion: {
5960
options: {
6061
version: "version",
6162
pattern: "/resources/**/*.{less,theme}"
62-
}
63+
},
64+
supportsDifferentialUpdates: true,
6365
},
6466
buildThemes: {
6567
requiresDependencies: true,
@@ -114,13 +116,15 @@ test("Standard build for non root project", (t) => {
114116
options: {
115117
copyright: "copyright",
116118
pattern: "/resources/**/*.{less,theme}"
117-
}
119+
},
120+
supportsDifferentialUpdates: true,
118121
},
119122
replaceVersion: {
120123
options: {
121124
version: "version",
122125
pattern: "/resources/**/*.{less,theme}"
123-
}
126+
},
127+
supportsDifferentialUpdates: true,
124128
},
125129
buildThemes: {
126130
requiresDependencies: true,

0 commit comments

Comments
 (0)