Closed jonathankretzmer closed 1 year ago
@jonathankretzmer Yes, I can have a look. Would you mind sharing your code?
Not at all, here is my latest branch: https://github.com/jonathankretzmer/sfdx-browserforce-plugin/tree/dev/plugin-CompanyInformation/src/plugins/company-information
@jonathankretzmer Looks good so far.
Here's what fixes the test:
On branch dev/plugin-CompanyInformation
test: escape parentheses in RegEx
diff --git a/src/plugins/company-information/index.e2e-spec.ts b/src/plugins/company-information/index.e2e-spec.ts
index 20d2f12..efd5db5 100644
--- a/src/plugins/company-information/index.e2e-spec.ts
+++ b/src/plugins/company-information/index.e2e-spec.ts
@@ -18,7 +18,7 @@ describe(CompanyInformation.name, function () {
]);
assert.deepStrictEqual(apply.status, 0, apply.output.toString());
assert.ok(
- /to '"English (South Africa) - ZAR"'/.test(apply.output.toString()),
+ /to '"English \(South Africa\) - ZAR"'/.test(apply.output.toString()),
apply.output.toString()
);
});
@@ -32,7 +32,7 @@ describe(CompanyInformation.name, function () {
]);
assert.deepStrictEqual(apply.status, 0, apply.output.toString());
assert.ok(
- /to '"English (Ireland) - EUR"'/.test(apply.output.toString()),
+ /to '"English \(Ireland\) - EUR"'/.test(apply.output.toString()),
apply.output.toString()
);
});
But of course that makes sense, hahah. Thanks :) Will submit a PR for this shortly.
I found the root cause of my issue. It relates to the bin/run
executable, on Windows I had to use bin/run.cmd
.
We need to be able to set the Org currency as the scratch org default, based on our hosting location, defaults to Ireland Euro. So I have created a plugin allowing changing fields on the Company Information section in Setup.
I am struggling with the last part of executing my e2e mocha tests.
When running the command
npm run test:e2e -- --grep "CompanyInformation"
it correctly finds and executes the tests in my file, but comes back with errors.The
.status
and.output
from the spawnSync are null.Would appreciate pointing me in the right direction to finalise this.
Thanks.