Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add 'generateThemeDesignerResources' task #565

Merged
merged 2 commits into from
Jan 14, 2021

Conversation

matz3
Copy link
Member

@matz3 matz3 commented Dec 17, 2020

No description provided.

@coveralls
Copy link

coveralls commented Dec 18, 2020

Coverage Status

Coverage increased (+0.1%) to 93.393% when pulling f765802 on generateThemeDesignerResources into 780531a on master.

@matz3 matz3 force-pushed the generateThemeDesignerResources branch from 4ce59d7 to 46c9824 Compare January 7, 2021 15:19
@matz3 matz3 requested a review from RandomByte January 11, 2021 14:54
* @param {object} parameters.options Options
* @param {string} parameters.options.projectName Project name
* @param {string} parameters.options.version Project version
* @param {string} [parameters.options.namespace] Namespace of the library
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param {string} [parameters.options.namespace] Namespace of the library
* @param {string} [parameters.options.namespace] If the project is a library, provide its namespace. Omit for theme-libraries

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@matz3 matz3 requested a review from KlattG January 12, 2021 15:55
KlattG
KlattG previously approved these changes Jan 13, 2021
Copy link
Contributor

@KlattG KlattG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

lib/tasks/generateThemeDesignerResources.js Outdated Show resolved Hide resolved
KlattG
KlattG previously approved these changes Jan 13, 2021
Copy link
Contributor

@KlattG KlattG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

`Error: ENOENT: no such file or directory, open /resources/sap/ui/core/themes/sap_fiori_3/foo.less`
});

t.is(fs.readFile.callCount, 1, "fs.readFile should not be called");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
t.is(fs.readFile.callCount, 1, "fs.readFile should not be called");
t.is(fs.readFile.callCount, 1, "fs.readFile should be called once");

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or remove the assertion

if (err.code === "ENOENT") {
throw new Error(
`libraryLessGenerator: Unable to resolve import '${originalFilePath}' from '${baseDir}'\n` +
err
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
err
err.message

?

err
);
} else {
throw err;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uncovered line (and branch). Should be easy to test, just like the other branch.

sinon.restore();
});

test.serial("processor", async (t) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are all the tests serial? I don't see how they could interfere with one another.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I've added it because of the sinon.restore() in the afterEach hook.
But restoring isn't required as no existing functions are spied/stubbed.

["/resources/sap/ui/demo/lib/themes/sap_fiori_3/.theming"]);

t.is(workspace.write.callCount, 7);
t.is(workspace.write.getCall(0).args.length, 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would appreciate some assertion messages here. Especially in those cases where no named variable is used.

t.is(workspace.write.getCall(1).args[0], libraryLessResource);
});

test.serial("generateThemeDesignerResources: Library sap.ui.documentation", async (t) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
test.serial("generateThemeDesignerResources: Library sap.ui.documentation", async (t) => {
test.serial("generateThemeDesignerResources: Library sap.ui.documentation is skipped", async (t) => {

matz3 and others added 2 commits January 14, 2021 13:58
Generates resources required for integration with the
SAP Theme Designer.

The task is not enabled by default as it is only relevant for the
OpenUI5 / SAPUI5 libraries.
@matz3 matz3 force-pushed the generateThemeDesignerResources branch from a22908a to f765802 Compare January 14, 2021 12:58
@matz3 matz3 merged commit 03241c0 into master Jan 14, 2021
@matz3 matz3 deleted the generateThemeDesignerResources branch January 14, 2021 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants