Skip to content

Commit

Permalink
Test: Fix application.a expected resources
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomByte committed Dec 16, 2019
1 parent 8f29205 commit c2742e7
Show file tree
Hide file tree
Showing 36 changed files with 222 additions and 64 deletions.
11 changes: 11 additions & 0 deletions test/expected/build/application.a/dest-deps-excl/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Application A</title>
<script id="sap-ui-bootstrap" src="test.js">
</script>
</head>
<body>

</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<library xmlns="http://www.sap.com/sap.ui.library.xsd" >

<name>library.a</name>
<vendor>SAP SE</vendor>
<copyright>Some fancy copyright ${currentYear}</copyright>
<version>1.0.0</version>

<documentation>Library A</documentation>

<dependencies>
<dependency>
<libraryName>library.d</libraryName>
</dependency>
</dependencies>

</library>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.library-a-foo{color:#fafad2;padding:1px 4px 3px 2px}
/* Inline theming parameters */
#sap-ui-theme-library\.a{background-image:url('data:text/plain;utf-8,%7B%22libraryAColor1%22%3A%22%23fafad2%22%7D')}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"libraryAColor1":"#fafad2"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.library-a-foo{color:#fafad2;padding:1px 2px 3px 4px}
/* Inline theming parameters */
#sap-ui-theme-library\.a{background-image:url('data:text/plain;utf-8,%7B%22libraryAColor1%22%3A%22%23fafad2%22%7D')}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@libraryAColor1: lightgoldenrodyellow;

.library-a-foo {
color: @libraryAColor1;
padding: 1px 2px 3px 4px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<library xmlns="http://www.sap.com/sap.ui.library.xsd" >

<name>library.b</name>
<vendor>SAP SE</vendor>
<copyright>Some fancy copyright ${currentYear}</copyright>
<version>1.0.0</version>

<documentation>Library B</documentation>

<dependencies>
<dependency>
<libraryName>library.d</libraryName>
</dependency>
</dependencies>

</library>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<library xmlns="http://www.sap.com/sap.ui.library.xsd" >

<name>library.c</name>
<vendor>SAP SE</vendor>
<copyright>${copyright}</copyright>
<version>1.0.0</version>

<documentation>Library C</documentation>

<dependencies>
<dependency>
<libraryName>library.d</libraryName>
</dependency>
</dependencies>

</library>
9 changes: 9 additions & 0 deletions test/expected/build/application.a/dest-deps-excl/test-dbg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sap.ui.define([
"library/d/some"
], function(someObject) {
function test(paramA) {
var variableA = paramA;
console.log(variableA);
}
test();
});
Empty file.
Empty file.
Empty file.
1 change: 1 addition & 0 deletions test/expected/build/application.a/dest-deps-excl/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()});
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<library xmlns="http://www.sap.com/sap.ui.library.xsd" >

<name>library.a</name>
<vendor>SAP SE</vendor>
<copyright>Some fancy copyright ${currentYear}</copyright>
<version>1.0.0</version>

<documentation>Library A</documentation>

<dependencies>
<dependency>
<libraryName>library.d</libraryName>
</dependency>
</dependencies>

</library>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.library-a-foo{color:#fafad2;padding:1px 4px 3px 2px}
/* Inline theming parameters */
#sap-ui-theme-library\.a{background-image:url('data:text/plain;utf-8,%7B%22libraryAColor1%22%3A%22%23fafad2%22%7D')}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"libraryAColor1":"#fafad2"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.library-a-foo{color:#fafad2;padding:1px 2px 3px 4px}
/* Inline theming parameters */
#sap-ui-theme-library\.a{background-image:url('data:text/plain;utf-8,%7B%22libraryAColor1%22%3A%22%23fafad2%22%7D')}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@libraryAColor1: lightgoldenrodyellow;

.library-a-foo {
color: @libraryAColor1;
padding: 1px 2px 3px 4px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<library xmlns="http://www.sap.com/sap.ui.library.xsd" >

<name>library.b</name>
<vendor>SAP SE</vendor>
<copyright>Some fancy copyright ${currentYear}</copyright>
<version>1.0.0</version>

<documentation>Library B</documentation>

<dependencies>
<dependency>
<libraryName>library.d</libraryName>
</dependency>
</dependencies>

</library>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<library xmlns="http://www.sap.com/sap.ui.library.xsd" >

<name>library.c</name>
<vendor>SAP SE</vendor>
<copyright>${copyright}</copyright>
<version>1.0.0</version>

<documentation>Library C</documentation>

<dependencies>
<dependency>
<libraryName>library.d</libraryName>
</dependency>
</dependencies>

</library>

This file was deleted.

Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<library xmlns="http://www.sap.com/sap.ui.library.xsd" >

<name>library.a</name>
<vendor>SAP SE</vendor>
<copyright>Some fancy copyright ${currentYear}</copyright>
<version>1.0.0</version>

<documentation>Library A</documentation>

<dependencies>
<dependency>
<libraryName>library.d</libraryName>
</dependency>
</dependencies>

</library>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.library-a-foo{color:#fafad2;padding:1px 4px 3px 2px}
/* Inline theming parameters */
#sap-ui-theme-library\.a{background-image:url('data:text/plain;utf-8,%7B%22libraryAColor1%22%3A%22%23fafad2%22%7D')}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"libraryAColor1":"#fafad2"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.library-a-foo{color:#fafad2;padding:1px 2px 3px 4px}
/* Inline theming parameters */
#sap-ui-theme-library\.a{background-image:url('data:text/plain;utf-8,%7B%22libraryAColor1%22%3A%22%23fafad2%22%7D')}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@libraryAColor1: lightgoldenrodyellow;

.library-a-foo {
color: @libraryAColor1;
padding: 1px 2px 3px 4px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<library xmlns="http://www.sap.com/sap.ui.library.xsd" >

<name>library.b</name>
<vendor>SAP SE</vendor>
<copyright>Some fancy copyright ${currentYear}</copyright>
<version>1.0.0</version>

<documentation>Library B</documentation>

<dependencies>
<dependency>
<libraryName>library.d</libraryName>
</dependency>
</dependencies>

</library>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<library xmlns="http://www.sap.com/sap.ui.library.xsd" >

<name>library.c</name>
<vendor>SAP SE</vendor>
<copyright>${copyright}</copyright>
<version>1.0.0</version>

<documentation>Library C</documentation>

<dependencies>
<dependency>
<libraryName>library.d</libraryName>
</dependency>
</dependencies>

</library>

This file was deleted.

Empty file.
Empty file.
Empty file.
17 changes: 9 additions & 8 deletions test/lib/builder/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const applicationGPath = path.join(__dirname, "..", "..", "fixtures", "applicati
const applicationHPath = path.join(__dirname, "..", "..", "fixtures", "application.h");
const applicationIPath = path.join(__dirname, "..", "..", "fixtures", "application.i");
const applicationJPath = path.join(__dirname, "..", "..", "fixtures", "application.j");
const collectionPath = path.join(__dirname, "..", "..", "fixtures", "collection");
const libraryDPath = path.join(__dirname, "..", "..", "fixtures", "library.d");
const libraryEPath = path.join(__dirname, "..", "..", "fixtures", "library.e");
const libraryHPath = path.join(__dirname, "..", "..", "fixtures", "library.h");
Expand Down Expand Up @@ -115,7 +116,7 @@ test("Build application.a with dependencies", (t) => {
return builder.build({
tree: applicationATree,
destPath,
excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters"],
excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters", "generateLibraryManifest"],
buildDependencies: true
}).then(() => {
return findFiles(expectedPath);
Expand All @@ -136,7 +137,7 @@ test("Build application.a with dependencies include", (t) => {
return builder.build({
tree: applicationATree,
destPath,
excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters"],
excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters", "generateLibraryManifest"],
buildDependencies: true, includedDependencies: ["*"]
}).then(() => {
return findFiles(expectedPath);
Expand All @@ -152,12 +153,12 @@ test("Build application.a with dependencies include", (t) => {

test("Build application.a with dependencies exclude", (t) => {
const destPath = "./test/tmp/build/application.a/dest-deps-excl";
const expectedPath = path.join("test", "expected", "build", "application.a", "dest");
const expectedPath = path.join("test", "expected", "build", "application.a", "dest-deps-excl");

return builder.build({
tree: applicationATree,
destPath,
excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters"],
excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters", "generateLibraryManifest"],
buildDependencies: true, excludedDependencies: ["library.d"]
}).then(() => {
return findFiles(expectedPath);
Expand Down Expand Up @@ -199,7 +200,7 @@ test("Build application.a with dependencies self-contained", (t) => {
return builder.build({
tree: applicationATree,
destPath,
excludedTasks: ["generateComponentPreload", "generateVersionInfo", "escapeNonAsciiCharacters"],
excludedTasks: ["generateComponentPreload", "generateVersionInfo", "escapeNonAsciiCharacters", "generateLibraryManifest"],
buildDependencies: true,
selfContained: true
}).then(() => {
Expand Down Expand Up @@ -630,7 +631,7 @@ const applicationATree = {
{
"id": "library.a",
"version": "1.0.0",
"path": path.join(applicationAPath, "node_modules", "collection", "library.a"),
"path": path.join(collectionPath, "library.a"),
"dependencies": [],
"_level": 1,
"specVersion": "0.1",
Expand All @@ -656,7 +657,7 @@ const applicationATree = {
{
"id": "library.b",
"version": "1.0.0",
"path": path.join(applicationAPath, "node_modules", "collection", "library.b"),
"path": path.join(collectionPath, "library.b"),
"dependencies": [],
"_level": 1,
"specVersion": "0.1",
Expand All @@ -682,7 +683,7 @@ const applicationATree = {
{
"id": "library.c",
"version": "1.0.0",
"path": path.join(applicationAPath, "node_modules", "collection", "library.c"),
"path": path.join(collectionPath, "library.c"),
"dependencies": [],
"_level": 1,
"specVersion": "0.1",
Expand Down

0 comments on commit c2742e7

Please sign in to comment.