-
Notifications
You must be signed in to change notification settings - Fork 22
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
Conversation
4ce59d7
to
46c9824
Compare
* @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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t.is(fs.readFile.callCount, 1, "fs.readFile should not be called"); | |
t.is(fs.readFile.callCount, 1, "fs.readFile should be called once"); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err | |
err.message |
?
err | ||
); | ||
} else { | ||
throw err; |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test.serial("generateThemeDesignerResources: Library sap.ui.documentation", async (t) => { | |
test.serial("generateThemeDesignerResources: Library sap.ui.documentation is skipped", async (t) => { |
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.
a22908a
to
f765802
Compare
No description provided.