From 80d5a8942fcbbecf09605ac90ac80ed7bdee45e1 Mon Sep 17 00:00:00 2001 From: hung-nguyen Date: Sat, 11 May 2024 10:12:43 +0700 Subject: [PATCH 1/2] test(create-plugin): add test cases for JsSdk-5,6 --- packages/create-plugin/__e2e__/e2e.test.ts | 24 ++- .../__e2e__/fixtures/languageEN.ts | 95 +++++++++ .../__e2e__/fixtures/languageJA.ts | 95 +++++++++ .../__e2e__/utils/CreatePlugin.ts | 187 ++++++++++++++++++ .../__e2e__/utils/executeCommand.ts | 86 -------- .../__e2e__/utils/generateWorkingDir.ts | 9 - .../create-plugin/__e2e__/utils/helper.ts | 10 + 7 files changed, 402 insertions(+), 104 deletions(-) create mode 100644 packages/create-plugin/__e2e__/fixtures/languageEN.ts create mode 100644 packages/create-plugin/__e2e__/fixtures/languageJA.ts create mode 100644 packages/create-plugin/__e2e__/utils/CreatePlugin.ts delete mode 100644 packages/create-plugin/__e2e__/utils/generateWorkingDir.ts diff --git a/packages/create-plugin/__e2e__/e2e.test.ts b/packages/create-plugin/__e2e__/e2e.test.ts index 80d3896633..9c575a9edf 100644 --- a/packages/create-plugin/__e2e__/e2e.test.ts +++ b/packages/create-plugin/__e2e__/e2e.test.ts @@ -1,13 +1,12 @@ import assert from "assert"; -import type { QuestionInput } from "./utils/executeCommand"; -import { executeCommandWithInteractiveInput } from "./utils/executeCommand"; +import type { QuestionInput } from "./utils/CreatePlugin"; import { CREATE_PLUGIN_COMMAND, DEFAULT_ANSWER, ANSWER_NO, } from "./utils/constants"; import path from "path"; -import { generateWorkingDir } from "./utils/generateWorkingDir"; +import { generateWorkingDir } from "./utils/helper"; import fs from "fs"; import { rimrafSync } from "rimraf"; import { @@ -19,11 +18,14 @@ import { pattern as requiredOptions } from "./fixtures/requiredOptions"; import { pattern as pluginNameContain64Chars } from "./fixtures/pluginNameContain64Chars"; import { pattern as pluginDescriptionContain200Chars } from "./fixtures/pluginDescriptionContain200Chars"; import { pattern as allOptions } from "./fixtures/allOptions"; +import { pattern as languageEN } from "./fixtures/languageEN"; +import { pattern as languageJA } from "./fixtures/languageJA"; import { pattern as emptyOutputDir } from "./fixtures/emptyOutputDir"; import { pattern as pluginNameContain65Chars } from "./fixtures/pluginNameContain65Chars"; import { pattern as pluginDescriptionContain201Chars } from "./fixtures/pluginDescriptionContain201Chars"; import { pattern as existOutputDir } from "./fixtures/existOutputDir"; import { pattern as createKintonePluginCommand } from "./fixtures/createKintonePluginCommand"; +import { CreatePlugin } from "./utils/CreatePlugin"; export type TestPattern = { description: string; @@ -58,6 +60,8 @@ describe("create-plugin", function () { pluginNameContain64Chars, pluginDescriptionContain200Chars, allOptions, + languageEN, + languageJA, emptyOutputDir, existOutputDir, pluginNameContain65Chars, @@ -70,13 +74,14 @@ describe("create-plugin", function () { prepareFn({ workingDir }); } - const response = await executeCommandWithInteractiveInput({ + const createPlugin = new CreatePlugin({ command: input.command, workingDir, outputDir: input.outputDir, questionsInput: input.questionsInput, commandArguments: input.commandArgument, }); + const response = await createPlugin.executeCommand(); if (expected.success !== undefined) { assert(response.status === 0, "Failed to create plugin"); @@ -95,14 +100,14 @@ describe("create-plugin", function () { assert.notEqual(response.status, 0, "The command should throw an error."); if (expected.failure.stdout) { assert.match( - response.stdout.toString().trim(), + response.stdout.trim(), new RegExp(expected.failure.stdout), ); } if (expected.failure.stderr) { assert.match( - response.stderr.toString().trim(), + response.stderr.trim(), new RegExp(expected.failure.stderr), ); } @@ -150,23 +155,24 @@ describe("create-plugin", function () { }, ]; - const response = await executeCommandWithInteractiveInput({ + const createPlugin = new CreatePlugin({ command: CREATE_PLUGIN_COMMAND, workingDir, outputDir, questionsInput, }); + const response = await createPlugin.executeCommand(); if (isWindows) { assert.equal(response.status, 0); assert.match( - response.stderr.toString().trim(), + response.stderr.trim(), /Could not create a plug-in project. Error:\nEINVAL: invalid argument, mkdir '.*:'/, ); } else { assert.notEqual(response.status, 0); assert.match( - response.stderr.toString().trim(), + response.stderr.trim(), /Error: \/ already exists. Choose a different directory/, ); } diff --git a/packages/create-plugin/__e2e__/fixtures/languageEN.ts b/packages/create-plugin/__e2e__/fixtures/languageEN.ts new file mode 100644 index 0000000000..07dcb07277 --- /dev/null +++ b/packages/create-plugin/__e2e__/fixtures/languageEN.ts @@ -0,0 +1,95 @@ +import type { TestPattern } from "../e2e.test"; +import { + ANSWER_NO, + ANSWER_YES, + CREATE_PLUGIN_COMMAND, +} from "../utils/constants"; +import { getBoundMessage } from "../../src/messages"; + +const lang = "en"; +const m = getBoundMessage(lang); + +export const pattern: TestPattern = { + description: + "#JsSdkTest-5 Should able to create plugin with --lang argument (EN language)", + input: { + command: CREATE_PLUGIN_COMMAND, + outputDir: "test5", + commandArgument: `--lang ${lang}`, + questionsInput: [ + { + question: m("Q_NameEn"), + answer: "test5-name", + }, + { + question: m("Q_DescriptionEn"), + answer: "test5-description", + }, + { + question: m("Q_SupportJa"), + answer: ANSWER_YES, + }, + { + question: m("Q_NameJa"), + answer: "私のプラグイン", + }, + { + question: m("Q_DescriptionJa"), + answer: "私のプラグイン", + }, + { + question: m("Q_SupportZh"), + answer: ANSWER_YES, + }, + { + question: m("Q_NameZh"), + answer: "我的插件", + }, + { + question: m("Q_DescriptionZh"), + answer: "我的插件", + }, + { + question: m("Q_WebsiteUrlEn"), + answer: "https://github.com", + }, + { + question: m("Q_WebsiteUrlJa"), + answer: "https://github.jp", + }, + { + question: m("Q_WebsiteUrlZh"), + answer: "https://github.cn", + }, + { + question: m("Q_MobileSupport"), + answer: ANSWER_NO, + }, + { + question: m("Q_EnablePluginUploader"), + answer: ANSWER_NO, + }, + ], + }, + expected: { + success: { + manifestJson: { + name: { + en: "test5-name", + ja: "私のプラグイン", + zh: "我的插件", + }, + description: { + en: "test5-description", + ja: "私のプラグイン", + zh: "我的插件", + }, + homepage_url: { + en: "https://github.com", + ja: "https://github.jp", + zh: "https://github.cn", + }, + }, + }, + }, +}; diff --git a/packages/create-plugin/__e2e__/fixtures/languageJA.ts b/packages/create-plugin/__e2e__/fixtures/languageJA.ts new file mode 100644 index 0000000000..f0b3956331 --- /dev/null +++ b/packages/create-plugin/__e2e__/fixtures/languageJA.ts @@ -0,0 +1,95 @@ +import type { TestPattern } from "../e2e.test"; +import { + ANSWER_NO, + ANSWER_YES, + CREATE_PLUGIN_COMMAND, +} from "../utils/constants"; +import { getBoundMessage } from "../../src/messages"; + +const lang = "ja"; +const m = getBoundMessage(lang); + +export const pattern: TestPattern = { + description: + "#JsSdkTest-6 Should able to create plugin with --lang argument (JA language)", + input: { + command: CREATE_PLUGIN_COMMAND, + outputDir: "test6", + commandArgument: `--lang ${lang}`, + questionsInput: [ + { + question: m("Q_NameEn"), + answer: "test6-name", + }, + { + question: m("Q_DescriptionEn"), + answer: "test6-description", + }, + { + question: m("Q_SupportJa"), + answer: ANSWER_YES, + }, + { + question: m("Q_NameJa"), + answer: "私のプラグイン", + }, + { + question: m("Q_DescriptionJa"), + answer: "私のプラグイン", + }, + { + question: m("Q_SupportZh"), + answer: ANSWER_YES, + }, + { + question: m("Q_NameZh"), + answer: "我的插件", + }, + { + question: m("Q_DescriptionZh"), + answer: "我的插件", + }, + { + question: m("Q_WebsiteUrlEn"), + answer: "https://github.com", + }, + { + question: m("Q_WebsiteUrlJa"), + answer: "https://github.jp", + }, + { + question: m("Q_WebsiteUrlZh"), + answer: "https://github.cn", + }, + { + question: m("Q_MobileSupport"), + answer: ANSWER_NO, + }, + { + question: m("Q_EnablePluginUploader"), + answer: ANSWER_NO, + }, + ], + }, + expected: { + success: { + manifestJson: { + name: { + en: "test6-name", + ja: "私のプラグイン", + zh: "我的插件", + }, + description: { + en: "test6-description", + ja: "私のプラグイン", + zh: "我的插件", + }, + homepage_url: { + en: "https://github.com", + ja: "https://github.jp", + zh: "https://github.cn", + }, + }, + }, + }, +}; diff --git a/packages/create-plugin/__e2e__/utils/CreatePlugin.ts b/packages/create-plugin/__e2e__/utils/CreatePlugin.ts new file mode 100644 index 0000000000..7d9cab9787 --- /dev/null +++ b/packages/create-plugin/__e2e__/utils/CreatePlugin.ts @@ -0,0 +1,187 @@ +import type { ChildProcessByStdio } from "child_process"; +import type { Readable, Writable } from "node:stream"; +import fs from "fs"; +import path from "path"; +import { execCommand } from "./executeCommand"; + +export type QuestionInput = { + question: string; + answer: string; +}; + +type Response = { + stdout: string; + stderr: string; + status?: number | null; +}; + +export class CreatePlugin { + private readonly command: string; + private readonly workingDir: string; + private readonly outputDir: string; + private readonly commandArguments: string; + private readonly questionsInput: QuestionInput[]; + private _childProcess?: ChildProcessByStdio; + private currentStep: number; + private _response?: Response; + private _stdout: string; + private _stderr: string; + + constructor(options: { + command: string; + workingDir: string; + outputDir: string; + questionsInput: QuestionInput[]; + commandArguments?: string; + }) { + this.command = options.command; + this.workingDir = options.workingDir; + this.outputDir = options.outputDir; + this.questionsInput = options.questionsInput; + this.commandArguments = options.commandArguments ?? ""; + this.currentStep = 0; + this._stdout = ""; + this._stderr = ""; + } + + public get childProcess() { + if (this._childProcess === undefined) { + throw new Error( + "No child process found. Please call the 'start' method first.", + ); + } + return this._childProcess; + } + + public set childProcess(value) { + this._childProcess = value; + } + + public get response() { + if (this._response === undefined) { + throw new Error( + "No response found. Please call the 'start' method first.", + ); + } + return this._response; + } + + public set response(value) { + this._response = value; + } + + async executeCommand(): Promise { + const commands = this._getCommands(); + if (!commands[this.command]) { + throw new Error(`Command ${this.command} not found.`); + } + + const commandString = `${commands[this.command]} ${this.commandArguments || ""} "${this.outputDir}"`; + this.childProcess = execCommand("node", commandString, { + cwd: this.workingDir, + }); + + const cliExitPromise = new Promise((resolve, reject) => { + this.childProcess.on("exit", (code: number) => { + this.response = { + status: code, + stdout: this._stdout ? this._stdout.toString() : "", + stderr: this._stderr ? this._stderr.toString() : "", + }; + resolve(this.response); + }); + this.childProcess.on("error", (error) => { + reject({ + error, + }); + }); + }); + + this.childProcess.stdout.on("data", (data: Buffer) => { + this._stdout = this._stdout.concat(data.toString()); + if (process.env.VERBOSE && ["true", "1"].includes(process.env.VERBOSE)) { + console.log(this._stdout); + } + }); + + this.childProcess.stderr.on("data", (data: Buffer) => { + this._stderr = this._stderr.concat(data.toString()); + this.done(); + }); + + while (this.currentStep < this.questionsInput.length) { + this.childProcess.stdin.write( + `${this.questionsInput[this.currentStep].answer}\n`, + ); + this.currentStep++; + + if (this.currentStep < this.questionsInput.length) { + await this.waitUntilStdioIncludes( + `${this.questionsInput[this.currentStep].question}`, + ); + } else { + this.done(); + } + } + + return cliExitPromise; + } + + done() { + this.childProcess.stdin.end(); + } + + getResponse(): Response { + return this.response; + } + + private _getCommands = (): { [key: string]: string } => { + const packageJson = JSON.parse( + fs.readFileSync(path.resolve("package.json"), "utf8"), + ); + return Object.fromEntries( + Object.entries(packageJson.bin).map(([command, relativePath]) => { + return [command, path.resolve(relativePath as string)]; + }), + ); + }; + + private waitUntilStdioIncludes( + message: string, + options: { timeout: number; interval: number } = { + timeout: 10000, + interval: 500, + }, + ): Promise { + return new Promise((resolve, reject) => { + const { timeout, interval } = options; + let timer: NodeJS.Timeout; + const timeoutTimer = setTimeout(() => { + clearInterval(timer); + this.done(); + reject( + new Error( + `Timeout (${timeout}ms) exceeded when waiting for stdout: ${message}`, + ), + ); + }, timeout); + + const regex = new RegExp(this.escape(message)); + timer = setInterval(() => { + if (regex.test(this._stdout) || this._isProcessExited()) { + clearInterval(timer); + clearTimeout(timeoutTimer); + resolve(); + } + }, interval); + }); + } + + private escape(question: string): string { + return question.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + } + + private _isProcessExited() { + return this.childProcess.exitCode !== null; + } +} diff --git a/packages/create-plugin/__e2e__/utils/executeCommand.ts b/packages/create-plugin/__e2e__/utils/executeCommand.ts index 96f5d6dcab..3439a82f4f 100644 --- a/packages/create-plugin/__e2e__/utils/executeCommand.ts +++ b/packages/create-plugin/__e2e__/utils/executeCommand.ts @@ -1,29 +1,4 @@ import { spawn } from "child_process"; -import fs from "fs"; -import path from "path"; - -export type Response = { - status: number; - stdout: Buffer; - stderr: Buffer; - error?: Error; -}; - -export type QuestionInput = { - question: string; - answer: string; -}; - -export const getCommands = (): { [key: string]: string } => { - const packageJson = JSON.parse( - fs.readFileSync(path.resolve("package.json"), "utf8"), - ); - return Object.fromEntries( - Object.entries(packageJson.bin).map(([command, relativePath]) => { - return [command, path.resolve(relativePath as string)]; - }), - ); -}; export const execCommand = ( command: string, @@ -61,67 +36,6 @@ const replaceTokenWithEnvVars = ( .replace(/\$\$[a-zA-Z0-9_]+/g, processEnvReplacer) .replace(/\$[a-zA-Z0-9_]+/g, inputEnvReplacer(envVars)); -export const executeCommandWithInteractiveInput = async (options: { - command: string; - workingDir: string; - outputDir: string; - questionsInput: QuestionInput[]; - commandArguments?: string; -}) => { - const { command, workingDir, outputDir, questionsInput, commandArguments } = - options; - const commands = getCommands(); - if (!commands[command]) { - throw new Error(`Command ${command} not found.`); - } - - const commandString = `${commands[command]} ${commandArguments || ""} "${outputDir}"`; - const cliProcess = execCommand("node", commandString, { - cwd: workingDir, - }); - - let stdout: Buffer; - let stderr: Buffer; - - const cliExitPromise = new Promise((resolve, reject) => { - cliProcess.on("exit", (code: number) => { - resolve({ - status: code, - stdout: stdout ?? Buffer.from(""), - stderr: stderr ?? Buffer.from(""), - }); - }); - cliProcess.on("error", (error) => { - reject({ - error, - }); - }); - }); - - let currentStep = 0; - cliProcess.stdout.on("data", async (data: Buffer) => { - const output = data.toString(); - stdout = stdout ? Buffer.concat([stdout, data]) : data; - if (currentStep === questionsInput.length || !questionsInput[currentStep]) { - cliProcess.stdin.end(); - return; - } - - if (output.includes(questionsInput[currentStep].question)) { - cliProcess.stdin.write(questionsInput[currentStep].answer); - cliProcess.stdin.write("\n"); - currentStep++; - } - }); - - cliProcess.stderr.on("data", async (data: Buffer) => { - stderr = stderr ? Buffer.concat([stderr, data]) : data; - cliProcess.stdin.end(); - }); - - return cliExitPromise; -}; - const processEnvReplacer = (substring: string) => { const key = substring.replace("$$", ""); const value = process.env[key]; diff --git a/packages/create-plugin/__e2e__/utils/generateWorkingDir.ts b/packages/create-plugin/__e2e__/utils/generateWorkingDir.ts deleted file mode 100644 index ef37c544a0..0000000000 --- a/packages/create-plugin/__e2e__/utils/generateWorkingDir.ts +++ /dev/null @@ -1,9 +0,0 @@ -import fs from "fs"; -import path from "path"; -import os from "os"; - -export const generateWorkingDir = (): string => { - return fs.mkdtempSync( - path.join(os.tmpdir(), `create-plugin-e2e-test-${new Date().valueOf()}-`), - ); -}; diff --git a/packages/create-plugin/__e2e__/utils/helper.ts b/packages/create-plugin/__e2e__/utils/helper.ts index d66c2f6c58..fc4b7e029a 100644 --- a/packages/create-plugin/__e2e__/utils/helper.ts +++ b/packages/create-plugin/__e2e__/utils/helper.ts @@ -1,3 +1,7 @@ +import fs from "fs"; +import path from "path"; +import os from "os"; + export const generateRandomString = (length: number) => { let result = ""; const characters = @@ -10,3 +14,9 @@ export const generateRandomString = (length: number) => { } return result; }; + +export const generateWorkingDir = (): string => { + return fs.mkdtempSync( + path.join(os.tmpdir(), `create-plugin-e2e-test-${new Date().valueOf()}-`), + ); +}; From 157b602de54fbc19789016ffa7280046d7cd166c Mon Sep 17 00:00:00 2001 From: hung-nguyen Date: Sun, 12 May 2024 09:43:59 +0700 Subject: [PATCH 2/2] test: add test cases for JsSdk7-8 --- packages/create-plugin/__e2e__/e2e.test.ts | 7 ++- .../__e2e__/fixtures/minimumTemplate.ts | 63 +++++++++++++++++++ .../__e2e__/fixtures/modernTemplate.ts | 63 +++++++++++++++++++ .../__e2e__/utils/CreatePlugin.ts | 6 +- .../__e2e__/utils/verification.ts | 2 +- 5 files changed, 135 insertions(+), 6 deletions(-) create mode 100644 packages/create-plugin/__e2e__/fixtures/minimumTemplate.ts create mode 100644 packages/create-plugin/__e2e__/fixtures/modernTemplate.ts diff --git a/packages/create-plugin/__e2e__/e2e.test.ts b/packages/create-plugin/__e2e__/e2e.test.ts index 9c575a9edf..987a01f890 100644 --- a/packages/create-plugin/__e2e__/e2e.test.ts +++ b/packages/create-plugin/__e2e__/e2e.test.ts @@ -1,5 +1,6 @@ import assert from "assert"; import type { QuestionInput } from "./utils/CreatePlugin"; +import type { PluginTemplate } from "./utils/verification"; import { CREATE_PLUGIN_COMMAND, DEFAULT_ANSWER, @@ -25,6 +26,8 @@ import { pattern as pluginNameContain65Chars } from "./fixtures/pluginNameContai import { pattern as pluginDescriptionContain201Chars } from "./fixtures/pluginDescriptionContain201Chars"; import { pattern as existOutputDir } from "./fixtures/existOutputDir"; import { pattern as createKintonePluginCommand } from "./fixtures/createKintonePluginCommand"; +import { pattern as minimumTemplate } from "./fixtures/minimumTemplate"; +import { pattern as modernTemplate } from "./fixtures/modernTemplate"; import { CreatePlugin } from "./utils/CreatePlugin"; export type TestPattern = { @@ -35,7 +38,7 @@ export type TestPattern = { outputDir: string; questionsInput: QuestionInput[]; commandArgument?: string; - template?: "minimum" | "modern"; + template?: PluginTemplate; }; expected: { success?: { @@ -62,6 +65,8 @@ describe("create-plugin", function () { allOptions, languageEN, languageJA, + minimumTemplate, + modernTemplate, emptyOutputDir, existOutputDir, pluginNameContain65Chars, diff --git a/packages/create-plugin/__e2e__/fixtures/minimumTemplate.ts b/packages/create-plugin/__e2e__/fixtures/minimumTemplate.ts new file mode 100644 index 0000000000..5cea667b1c --- /dev/null +++ b/packages/create-plugin/__e2e__/fixtures/minimumTemplate.ts @@ -0,0 +1,63 @@ +import type { TestPattern } from "../e2e.test"; +import { + ANSWER_NO, + CREATE_PLUGIN_COMMAND, + DEFAULT_ANSWER, +} from "../utils/constants"; +import { getBoundMessage } from "../../src/messages"; + +const m = getBoundMessage("en"); +const template = "minimum"; + +export const pattern: TestPattern = { + description: + "#JsSdkTest-7 Should able to create a plugin with minimum template", + input: { + command: CREATE_PLUGIN_COMMAND, + outputDir: "test7", + commandArgument: `--template ${template}`, + template, + questionsInput: [ + { + question: m("Q_NameEn"), + answer: "test7-name", + }, + { + question: m("Q_DescriptionEn"), + answer: "test7-description", + }, + { + question: m("Q_SupportJa"), + answer: DEFAULT_ANSWER, + }, + { + question: m("Q_SupportZh"), + answer: DEFAULT_ANSWER, + }, + { + question: m("Q_WebsiteUrlEn"), + answer: DEFAULT_ANSWER, + }, + { + question: m("Q_MobileSupport"), + answer: ANSWER_NO, + }, + { + question: m("Q_EnablePluginUploader"), + answer: ANSWER_NO, + }, + ], + }, + expected: { + success: { + manifestJson: { + name: { en: "test7-name" }, + description: { en: "test7-description" }, + desktop: { + js: ["js/desktop.js"], + css: ["css/51-modern-default.css", "css/desktop.css"], + }, + }, + }, + }, +}; diff --git a/packages/create-plugin/__e2e__/fixtures/modernTemplate.ts b/packages/create-plugin/__e2e__/fixtures/modernTemplate.ts new file mode 100644 index 0000000000..9d210a5329 --- /dev/null +++ b/packages/create-plugin/__e2e__/fixtures/modernTemplate.ts @@ -0,0 +1,63 @@ +import type { TestPattern } from "../e2e.test"; +import { + ANSWER_NO, + CREATE_PLUGIN_COMMAND, + DEFAULT_ANSWER, +} from "../utils/constants"; +import { getBoundMessage } from "../../src/messages"; + +const m = getBoundMessage("en"); +const template = "modern"; + +export const pattern: TestPattern = { + description: + "#JsSdkTest-8 Should able to create a plugin with modern template", + input: { + command: CREATE_PLUGIN_COMMAND, + outputDir: "test8", + commandArgument: `--template ${template}`, + template, + questionsInput: [ + { + question: m("Q_NameEn"), + answer: "test8-name", + }, + { + question: m("Q_DescriptionEn"), + answer: "test8-description", + }, + { + question: m("Q_SupportJa"), + answer: DEFAULT_ANSWER, + }, + { + question: m("Q_SupportZh"), + answer: DEFAULT_ANSWER, + }, + { + question: m("Q_WebsiteUrlEn"), + answer: DEFAULT_ANSWER, + }, + { + question: m("Q_MobileSupport"), + answer: ANSWER_NO, + }, + { + question: m("Q_EnablePluginUploader"), + answer: ANSWER_NO, + }, + ], + }, + expected: { + success: { + manifestJson: { + name: { en: "test8-name" }, + description: { en: "test8-description" }, + desktop: { + js: ["js/desktop.js"], + css: ["css/desktop.css"], + }, + }, + }, + }, +}; diff --git a/packages/create-plugin/__e2e__/utils/CreatePlugin.ts b/packages/create-plugin/__e2e__/utils/CreatePlugin.ts index 7d9cab9787..1189e7c099 100644 --- a/packages/create-plugin/__e2e__/utils/CreatePlugin.ts +++ b/packages/create-plugin/__e2e__/utils/CreatePlugin.ts @@ -47,7 +47,7 @@ export class CreatePlugin { public get childProcess() { if (this._childProcess === undefined) { throw new Error( - "No child process found. Please call the 'start' method first.", + "No child process found. Please call 'executeCommand' first.", ); } return this._childProcess; @@ -59,9 +59,7 @@ export class CreatePlugin { public get response() { if (this._response === undefined) { - throw new Error( - "No response found. Please call the 'start' method first.", - ); + throw new Error("No response found. Please call 'executeCommand' first."); } return this._response; } diff --git a/packages/create-plugin/__e2e__/utils/verification.ts b/packages/create-plugin/__e2e__/utils/verification.ts index 452be9048f..9fb135d7d0 100644 --- a/packages/create-plugin/__e2e__/utils/verification.ts +++ b/packages/create-plugin/__e2e__/utils/verification.ts @@ -2,7 +2,7 @@ import fs from "fs"; import path from "path"; import assert from "assert"; -type PluginTemplate = "minimum" | "modern"; +export type PluginTemplate = "minimum" | "modern"; export const readPluginManifestJson = ( pluginDir: string,