-
Notifications
You must be signed in to change notification settings - Fork 1
Enable liquid batch testing #229
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
base: main
Are you sure you want to change the base?
Changes from all commits
500ce98
c376a9c
67103f0
1acc60c
cc3edb9
fdc8386
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -459,24 +459,30 @@ program | |
| .option("--html-preview", "Get a static html of the export-view of the template generated with the Liquid Test data (optional)", false) | ||
| .option("--preview-only", "Skip the checking of the results of the Liquid Test in case you only want to generate a preview template (optional)", false) | ||
| .option("--status", "Only return the status of the test runs as PASSED/FAILED (optional)", false) | ||
| .option("-p, --pattern <pattern>", "Run all tests that match this pattern (optional)", "") | ||
|
|
||
| .action((options) => { | ||
| if (!options.handle && !options.accountTemplate) { | ||
| consola.error("You need to specify either a reconciliation handle or an account template"); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| if (options.test && options.pattern) { | ||
| consola.error("You cannot use both --test and --pattern options at the same time"); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| const templateType = options.handle ? "reconciliationText" : "accountTemplate"; | ||
| const templateName = options.handle ? options.handle : options.accountTemplate; | ||
|
|
||
| if (options.status) { | ||
| liquidTestRunner.runTestsStatusOnly(options.firm, templateType, templateName, options.test); | ||
| liquidTestRunner.runTestsStatusOnly(options.firm, templateType, templateName, options.test, options.pattern); | ||
| } else { | ||
| if (options.previewOnly && !options.htmlInput && !options.htmlPreview) { | ||
| consola.info(`When using "--preview-only" you need to specify at least one of the following options: "--html-input", "--html-preview"`); | ||
| process.exit(1); | ||
| } | ||
| liquidTestRunner.runTestsWithOutput(options.firm, templateType, templateName, options.test, options.previewOnly, options.htmlInput, options.htmlPreview); | ||
| liquidTestRunner.runTestsWithOutput(options.firm, templateType, templateName, options.test, options.previewOnly, options.htmlInput, options.htmlPreview, options.pattern); | ||
| } | ||
| }); | ||
|
|
||
|
|
@@ -682,20 +688,26 @@ program | |
| .option("-t, --test <test-name>", `Specify the name of the test to be run (optional). It has to be used together with "--handle"`, "") | ||
| .option("--html", `Get a html file of the template's input-view generated with the Liquid Test information (optional). It has to be used together with "--handle"`, false) | ||
| .option("--yes", "Skip the prompt confirmation (optional)") | ||
| .option("-b, --pattern <pattern>", `Run all tests that match this pattern (optional). It has to be used together with "--handle" or "--account-template"`, "") | ||
| .action((options) => { | ||
| cliUtils.checkDefaultFirm(options.firm, firmIdDefault); | ||
| cliUtils.checkUniqueOption(["handle", "updateTemplates", "accountTemplate"], options); | ||
|
|
||
| if (options.test && options.pattern) { | ||
| consola.error("You cannot use both --test and --pattern options at the same time"); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| if (options.updateTemplates && !options.yes) { | ||
| cliUtils.promptConfirmation(); | ||
| } | ||
|
|
||
| if (options.accountTemplate) { | ||
| devMode.watchLiquidTest(options.firm, options.accountTemplate, options.test, options.html, "accountTemplate"); | ||
| devMode.watchLiquidTest(options.firm, options.accountTemplate, options.test, options.html, "accountTemplate", options.pattern); | ||
| } | ||
|
|
||
| if (options.handle) { | ||
| devMode.watchLiquidTest(options.firm, options.handle, options.test, options.html, "reconciliationText"); | ||
| devMode.watchLiquidTest(options.firm, options.handle, options.test, options.html, "reconciliationText", options.pattern); | ||
| } | ||
|
Comment on lines
+691
to
711
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider consistent short option for
🤖 Prompt for AI Agents |
||
| if (options.updateTemplates) { | ||
| devMode.watchLiquidFiles(options.firm); | ||
|
|
||
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.
Can you change the -b into -p?