From f70673f65b38b72a57e08e2795f0cff309302388 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Sun, 16 May 2021 17:22:00 -0300 Subject: [PATCH 1/2] Improve documentation. --- lib/run-context.js | 4 ++-- lib/run-result.js | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/run-context.js b/lib/run-context.js index ab3cd0d..9012d05 100644 --- a/lib/run-context.js +++ b/lib/run-context.js @@ -188,8 +188,8 @@ RunContext.prototype._run = function () { }; /** - * Run the generator on the environment and returns the promise. - * @return {Promise} Promise + * Run the generator on the environment and promises a RunResult instance. + * @return {Promise} Promise a RunResult instance. */ RunContext.prototype.run = function () { if (!this.settings.runEnvironment && this.buildAsync === undefined) { diff --git a/lib/run-result.js b/lib/run-result.js index dea2a00..4e42d03 100644 --- a/lib/run-result.js +++ b/lib/run-result.js @@ -18,7 +18,11 @@ function convertArgs(args) { return Array.isArray(arg) ? arg : [arg]; } -module.exports = class RunResult { +/** + * This class provides utilities for testing generated content. + */ + +class RunResult { constructor(options = {cwd: process.cwd()}) { this.env = options.env; this.cwd = options.cwd; @@ -350,3 +354,5 @@ module.exports = class RunResult { this.assertNoObjectContent(this._readFile(filename, true), content); } }; + +module.exports = RunResult; From ef1942f43d35343d6639580e0dcfe444f03f614a Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Sun, 16 May 2021 21:27:07 -0300 Subject: [PATCH 2/2] Update lib/run-result.js --- lib/run-result.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/run-result.js b/lib/run-result.js index 4e42d03..dcf0e8d 100644 --- a/lib/run-result.js +++ b/lib/run-result.js @@ -353,6 +353,6 @@ class RunResult { assertNoJsonFileContent(filename, content) { this.assertNoObjectContent(this._readFile(filename, true), content); } -}; +} module.exports = RunResult;