Skip to content

Commit

Permalink
[FEATURE] Build: Add 'jsdoc' command
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomByte committed Mar 12, 2019
1 parent 3745f39 commit 3a2f4a1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -68,6 +68,7 @@ The CLI automatically checks for updates using [update-notifier](https://github.
```
Commands:
dev Dev build: Skips non-essential and time-intensive tasks during build
jsdoc Build JSDoc resources
preload (default) Build project and create preload bundles
self-contained Build project and create self-contained bundle
Expand Down
6 changes: 6 additions & 0 deletions lib/cli/commands/build.js
Expand Up @@ -16,6 +16,11 @@ build.builder = function(cli) {
builder: noop,
middlewares: [baseMiddleware]
})
.command("jsdoc", "Build JSDoc resources", {
handler: handleBuild,
builder: noop,
middlewares: [baseMiddleware]
})
.command("preload", "(default) Build project and create preload bundles", {
handler: handleBuild,
builder: noop,
Expand Down Expand Up @@ -78,6 +83,7 @@ function handleBuild(argv) {
buildDependencies: argv.all,
dev: command === "dev",
selfContained: command === "self-contained",
jsdoc: command === "jsdoc",
devExcludeProject: argv["dev-exclude-project"],
includedTasks: argv["include-task"],
excludedTasks: argv["exclude-task"]
Expand Down
17 changes: 17 additions & 0 deletions test/lib/cli/commands/build.js
Expand Up @@ -24,6 +24,7 @@ const defaultBuilderArgs = {
buildDependencies: undefined,
dev: false,
selfContained: false,
jsdoc: false,
devExcludeProject: undefined,
includedTasks: undefined,
excludedTasks: undefined
Expand Down Expand Up @@ -82,3 +83,19 @@ test.serial("ui5 build self-contained", async (t) => {
"Self-contained build called with expected arguments"
);
});

test.serial("ui5 build jsdoc", async (t) => {
normalizerStub.resolves({
metadata:
{
name: "Sample"
}
});
args._ = ["build", "jsdoc"];
await build.handler(args);
t.deepEqual(
builderStub.getCall(0).args[0],
Object.assign({}, defaultBuilderArgs, {jsdoc: true}),
"JSDoc build called with expected arguments"
);
});

0 comments on commit 3a2f4a1

Please sign in to comment.