@simplysf/simply-cicd 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -38
- package/lib/commands/simply/cicd/build/lwc-jest.d.ts +2 -1
- package/lib/commands/simply/cicd/build/lwc-jest.js +8 -3
- package/lib/commands/simply/cicd/build/lwc-jest.js.map +1 -1
- package/lib/common/build/lwcJest.d.ts +17 -1
- package/lib/common/build/lwcJest.js +98 -8
- package/lib/common/build/lwcJest.js.map +1 -1
- package/messages/simply.cicd.build.lwc-jest.md +9 -1
- package/oclif.manifest.json +1245 -1237
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -84,7 +84,7 @@ EXAMPLES
|
|
|
84
84
|
$ sf simply cicd build cleanup-scratch-orgs --dev-hub my-devhub
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
_See code: [lib/commands/simply/cicd/build/cleanup-scratch-orgs.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
87
|
+
_See code: [lib/commands/simply/cicd/build/cleanup-scratch-orgs.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/build/cleanup-scratch-orgs.js)_
|
|
88
88
|
|
|
89
89
|
## `sf simply cicd build create-fallback-tag`
|
|
90
90
|
|
|
@@ -141,7 +141,7 @@ EXAMPLES
|
|
|
141
141
|
$ sf simply cicd build create-fallback-tag --ci-commit-ref-name main --ci-project-path group/project --project-access-token glpat-... --ci-pipeline-id 123
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
-
_See code: [lib/commands/simply/cicd/build/create-fallback-tag.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
144
|
+
_See code: [lib/commands/simply/cicd/build/create-fallback-tag.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/build/create-fallback-tag.js)_
|
|
145
145
|
|
|
146
146
|
## `sf simply cicd build create-package-version`
|
|
147
147
|
|
|
@@ -214,7 +214,7 @@ EXAMPLES
|
|
|
214
214
|
$ sf simply cicd build create-package-version --ci-commit-ref-name main --ci-commit-sha a1b2c3d --ci-pipeline-id 123 --ci-pipeline-url https://gitlab.example.com/pipelines/123 --ci-project-path group/project --project-access-token glpat-... --packaging-devhub my-packaging-devhub
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
-
_See code: [lib/commands/simply/cicd/build/create-package-version.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
217
|
+
_See code: [lib/commands/simply/cicd/build/create-package-version.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/build/create-package-version.js)_
|
|
218
218
|
|
|
219
219
|
## `sf simply cicd build create-scratch`
|
|
220
220
|
|
|
@@ -255,7 +255,7 @@ EXAMPLES
|
|
|
255
255
|
$ sf simply cicd build create-scratch --dev-hub my-devhub
|
|
256
256
|
```
|
|
257
257
|
|
|
258
|
-
_See code: [lib/commands/simply/cicd/build/create-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
258
|
+
_See code: [lib/commands/simply/cicd/build/create-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/build/create-scratch.js)_
|
|
259
259
|
|
|
260
260
|
## `sf simply cicd build delete-scratch`
|
|
261
261
|
|
|
@@ -294,7 +294,7 @@ EXAMPLES
|
|
|
294
294
|
$ sf simply cicd build delete-scratch --dev-hub my-devhub
|
|
295
295
|
```
|
|
296
296
|
|
|
297
|
-
_See code: [lib/commands/simply/cicd/build/delete-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
297
|
+
_See code: [lib/commands/simply/cicd/build/delete-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/build/delete-scratch.js)_
|
|
298
298
|
|
|
299
299
|
## `sf simply cicd build determine-package-changes`
|
|
300
300
|
|
|
@@ -327,7 +327,7 @@ EXAMPLES
|
|
|
327
327
|
$ sf simply cicd build determine-package-changes --out changes.env
|
|
328
328
|
```
|
|
329
329
|
|
|
330
|
-
_See code: [lib/commands/simply/cicd/build/determine-package-changes.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
330
|
+
_See code: [lib/commands/simply/cicd/build/determine-package-changes.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/build/determine-package-changes.js)_
|
|
331
331
|
|
|
332
332
|
## `sf simply cicd build generate-flexipage-diff`
|
|
333
333
|
|
|
@@ -385,7 +385,7 @@ EXAMPLES
|
|
|
385
385
|
$ sf simply cicd build generate-flexipage-diff --vcs-provider github --ci-repository my-org/my-repo --ci-pull-request-number 45 --ci-run-id 987 --from abc123 --to def456 --project-access-token ghp-...
|
|
386
386
|
```
|
|
387
387
|
|
|
388
|
-
_See code: [lib/commands/simply/cicd/build/generate-flexipage-diff.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
388
|
+
_See code: [lib/commands/simply/cicd/build/generate-flexipage-diff.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/build/generate-flexipage-diff.js)_
|
|
389
389
|
|
|
390
390
|
## `sf simply cicd build generate-flow-diff`
|
|
391
391
|
|
|
@@ -443,7 +443,7 @@ EXAMPLES
|
|
|
443
443
|
$ sf simply cicd build generate-flow-diff --vcs-provider github --ci-repository my-org/my-repo --ci-pull-request-number 45 --ci-run-id 987 --from abc123 --to def456 --project-access-token ghp-...
|
|
444
444
|
```
|
|
445
445
|
|
|
446
|
-
_See code: [lib/commands/simply/cicd/build/generate-flow-diff.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
446
|
+
_See code: [lib/commands/simply/cicd/build/generate-flow-diff.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/build/generate-flow-diff.js)_
|
|
447
447
|
|
|
448
448
|
## `sf simply cicd build install-dependencies`
|
|
449
449
|
|
|
@@ -494,7 +494,7 @@ FLAG DESCRIPTIONS
|
|
|
494
494
|
prompt in a pipeline, it is auto-approved.
|
|
495
495
|
```
|
|
496
496
|
|
|
497
|
-
_See code: [lib/commands/simply/cicd/build/install-dependencies.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
497
|
+
_See code: [lib/commands/simply/cicd/build/install-dependencies.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/build/install-dependencies.js)_
|
|
498
498
|
|
|
499
499
|
## `sf simply cicd build lwc-jest`
|
|
500
500
|
|
|
@@ -503,10 +503,15 @@ Install the LWC Jest test libraries and run the project's LWC Jest tests with co
|
|
|
503
503
|
```
|
|
504
504
|
USAGE
|
|
505
505
|
$ sf simply cicd build lwc-jest [--json] [--flags-dir <value>] [--debug] [--disabled]
|
|
506
|
+
[--lwc-jest-fail-on-test-failure]
|
|
506
507
|
|
|
507
508
|
FLAGS
|
|
508
|
-
--debug
|
|
509
|
-
--disabled
|
|
509
|
+
--debug [env: SIMPLY_CICD_DEBUG] Enable verbose debug logging.
|
|
510
|
+
--disabled [env: SIMPLY_CICD_DISABLED] Skip this job entirely, logging a warning instead of
|
|
511
|
+
running it.
|
|
512
|
+
--lwc-jest-fail-on-test-failure [env: SIMPLY_CICD_LWC_JEST_FAIL_ON_TEST_FAILURE] Exit non-zero when the LWC Jest
|
|
513
|
+
tests (or their install) fail, failing the pipeline. By default failures are only
|
|
514
|
+
logged.
|
|
510
515
|
|
|
511
516
|
GLOBAL FLAGS
|
|
512
517
|
--flags-dir=<value> Import flag values from a directory.
|
|
@@ -515,14 +520,21 @@ GLOBAL FLAGS
|
|
|
515
520
|
DESCRIPTION
|
|
516
521
|
Install the LWC Jest test libraries and run the project's LWC Jest tests with coverage.
|
|
517
522
|
|
|
518
|
-
Installs `@salesforce/sfdx-lwc-jest
|
|
519
|
-
|
|
523
|
+
Installs `@salesforce/sfdx-lwc-jest`, `@sa11y/jest`, and `jest-junit`, then runs `sfdx-lwc-jest --coverage --
|
|
524
|
+
--passWithNoTests` with the `jest-junit` reporter added to any reporters the project's own Jest config sets, writing a
|
|
525
|
+
JUnit report to `./test-results/lwc/test-result.xml` for the pipeline to upload as an artifact. By default failures
|
|
526
|
+
are logged, not thrown, so they don't fail the pipeline; pass `--lwc-jest-fail-on-test-failure` to make them exit
|
|
527
|
+
non-zero.
|
|
520
528
|
|
|
521
529
|
EXAMPLES
|
|
522
530
|
$ sf simply cicd build lwc-jest
|
|
531
|
+
|
|
532
|
+
Fail the pipeline when a test fails:
|
|
533
|
+
|
|
534
|
+
$ sf simply cicd build lwc-jest --lwc-jest-fail-on-test-failure
|
|
523
535
|
```
|
|
524
536
|
|
|
525
|
-
_See code: [lib/commands/simply/cicd/build/lwc-jest.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
537
|
+
_See code: [lib/commands/simply/cicd/build/lwc-jest.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/build/lwc-jest.js)_
|
|
526
538
|
|
|
527
539
|
## `sf simply cicd build publish-utam-page-objects`
|
|
528
540
|
|
|
@@ -625,7 +637,7 @@ EXAMPLES
|
|
|
625
637
|
--subscriber-package-version-id 04tXXXXXXXXXXXXXXX --dry-run
|
|
626
638
|
```
|
|
627
639
|
|
|
628
|
-
_See code: [lib/commands/simply/cicd/build/publish-utam-page-objects.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
640
|
+
_See code: [lib/commands/simply/cicd/build/publish-utam-page-objects.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/build/publish-utam-page-objects.js)_
|
|
629
641
|
|
|
630
642
|
## `sf simply cicd build push-scratch`
|
|
631
643
|
|
|
@@ -666,7 +678,7 @@ EXAMPLES
|
|
|
666
678
|
$ sf simply cicd build push-scratch --jwt-key-file ./server.key
|
|
667
679
|
```
|
|
668
680
|
|
|
669
|
-
_See code: [lib/commands/simply/cicd/build/push-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
681
|
+
_See code: [lib/commands/simply/cicd/build/push-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/build/push-scratch.js)_
|
|
670
682
|
|
|
671
683
|
## `sf simply cicd build test-scratch`
|
|
672
684
|
|
|
@@ -702,7 +714,7 @@ EXAMPLES
|
|
|
702
714
|
$ sf simply cicd build test-scratch --jwt-key-file ./server.key
|
|
703
715
|
```
|
|
704
716
|
|
|
705
|
-
_See code: [lib/commands/simply/cicd/build/test-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
717
|
+
_See code: [lib/commands/simply/cicd/build/test-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/build/test-scratch.js)_
|
|
706
718
|
|
|
707
719
|
## `sf simply cicd deploy happy-soup deploy-unpackaged`
|
|
708
720
|
|
|
@@ -753,7 +765,7 @@ EXAMPLES
|
|
|
753
765
|
$ sf simply cicd deploy happy-soup deploy-unpackaged --ci-job-token $CI_JOB_TOKEN --alias my-org --source-branch-name release/uat
|
|
754
766
|
```
|
|
755
767
|
|
|
756
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
768
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js)_
|
|
757
769
|
|
|
758
770
|
## `sf simply cicd deploy happy-soup deployment-close-out`
|
|
759
771
|
|
|
@@ -807,7 +819,7 @@ EXAMPLES
|
|
|
807
819
|
$ sf simply cicd deploy happy-soup deployment-close-out --ci-commit-ref-name main --ci-pipeline-id 123 --ci-project-path group/project --project-access-token $PROJECT_ACCESS_TOKEN --deploy-release-date 2026-01-15
|
|
808
820
|
```
|
|
809
821
|
|
|
810
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
822
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js)_
|
|
811
823
|
|
|
812
824
|
## `sf simply cicd deploy happy-soup install-packaged`
|
|
813
825
|
|
|
@@ -867,7 +879,7 @@ FLAG DESCRIPTIONS
|
|
|
867
879
|
prompt in a pipeline, it is auto-approved.
|
|
868
880
|
```
|
|
869
881
|
|
|
870
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
882
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js)_
|
|
871
883
|
|
|
872
884
|
## `sf simply cicd deploy happy-soup post-deploy`
|
|
873
885
|
|
|
@@ -918,7 +930,7 @@ EXAMPLES
|
|
|
918
930
|
$ sf simply cicd deploy happy-soup post-deploy --ci-job-token $CI_JOB_TOKEN --alias my-org --source-branch-name release/uat
|
|
919
931
|
```
|
|
920
932
|
|
|
921
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
933
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js)_
|
|
922
934
|
|
|
923
935
|
## `sf simply cicd deploy happy-soup post-destructive`
|
|
924
936
|
|
|
@@ -969,7 +981,7 @@ EXAMPLES
|
|
|
969
981
|
$ sf simply cicd deploy happy-soup post-destructive --ci-job-token $CI_JOB_TOKEN --alias my-org --source-branch-name release/uat
|
|
970
982
|
```
|
|
971
983
|
|
|
972
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
984
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js)_
|
|
973
985
|
|
|
974
986
|
## `sf simply cicd deploy happy-soup pre-destructive`
|
|
975
987
|
|
|
@@ -1020,7 +1032,7 @@ EXAMPLES
|
|
|
1020
1032
|
$ sf simply cicd deploy happy-soup pre-destructive --ci-job-token $CI_JOB_TOKEN --alias my-org --source-branch-name release/uat
|
|
1021
1033
|
```
|
|
1022
1034
|
|
|
1023
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1035
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js)_
|
|
1024
1036
|
|
|
1025
1037
|
## `sf simply cicd deploy happy-soup tag-deployment`
|
|
1026
1038
|
|
|
@@ -1072,7 +1084,7 @@ EXAMPLES
|
|
|
1072
1084
|
$ sf simply cicd deploy happy-soup tag-deployment --alias my-org --ci-pipeline-id 123 --ci-pipeline-url https://gitlab.example.com/group/project/-/pipelines/123 --ci-project-path group/project --ci-merge-request-iid 45 --ci-merge-request-project-url https://gitlab.example.com/group/project --project-access-token $PROJECT_ACCESS_TOKEN
|
|
1073
1085
|
```
|
|
1074
1086
|
|
|
1075
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1087
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js)_
|
|
1076
1088
|
|
|
1077
1089
|
## `sf simply cicd deploy happy-soup validate`
|
|
1078
1090
|
|
|
@@ -1110,7 +1122,7 @@ EXAMPLES
|
|
|
1110
1122
|
$ sf simply cicd deploy happy-soup validate --deploy-config-file deployment-configs/uat.json --deploy-rules-file config/deploy-rules.json
|
|
1111
1123
|
```
|
|
1112
1124
|
|
|
1113
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1125
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/validate.js)_
|
|
1114
1126
|
|
|
1115
1127
|
## `sf simply cicd deploy project deploy-unpackaged`
|
|
1116
1128
|
|
|
@@ -1158,7 +1170,7 @@ EXAMPLES
|
|
|
1158
1170
|
$ sf simply cicd deploy project deploy-unpackaged --ci-job-token $CI_JOB_TOKEN --alias my-org
|
|
1159
1171
|
```
|
|
1160
1172
|
|
|
1161
|
-
_See code: [lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1173
|
+
_See code: [lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js)_
|
|
1162
1174
|
|
|
1163
1175
|
## `sf simply cicd deploy project install-packaged`
|
|
1164
1176
|
|
|
@@ -1222,7 +1234,7 @@ FLAG DESCRIPTIONS
|
|
|
1222
1234
|
prompt in a pipeline, it is auto-approved.
|
|
1223
1235
|
```
|
|
1224
1236
|
|
|
1225
|
-
_See code: [lib/commands/simply/cicd/deploy/project/install-packaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1237
|
+
_See code: [lib/commands/simply/cicd/deploy/project/install-packaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/install-packaged.js)_
|
|
1226
1238
|
|
|
1227
1239
|
## `sf simply cicd deploy project post-deploy`
|
|
1228
1240
|
|
|
@@ -1270,7 +1282,7 @@ EXAMPLES
|
|
|
1270
1282
|
$ sf simply cicd deploy project post-deploy --ci-job-token $CI_JOB_TOKEN --alias my-org
|
|
1271
1283
|
```
|
|
1272
1284
|
|
|
1273
|
-
_See code: [lib/commands/simply/cicd/deploy/project/post-deploy.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1285
|
+
_See code: [lib/commands/simply/cicd/deploy/project/post-deploy.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/post-deploy.js)_
|
|
1274
1286
|
|
|
1275
1287
|
## `sf simply cicd deploy project post-destructive`
|
|
1276
1288
|
|
|
@@ -1318,7 +1330,7 @@ EXAMPLES
|
|
|
1318
1330
|
$ sf simply cicd deploy project post-destructive --ci-job-token $CI_JOB_TOKEN --alias my-org
|
|
1319
1331
|
```
|
|
1320
1332
|
|
|
1321
|
-
_See code: [lib/commands/simply/cicd/deploy/project/post-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1333
|
+
_See code: [lib/commands/simply/cicd/deploy/project/post-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/post-destructive.js)_
|
|
1322
1334
|
|
|
1323
1335
|
## `sf simply cicd deploy project pre-destructive`
|
|
1324
1336
|
|
|
@@ -1366,7 +1378,7 @@ EXAMPLES
|
|
|
1366
1378
|
$ sf simply cicd deploy project pre-destructive --ci-job-token $CI_JOB_TOKEN --alias my-org
|
|
1367
1379
|
```
|
|
1368
1380
|
|
|
1369
|
-
_See code: [lib/commands/simply/cicd/deploy/project/pre-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1381
|
+
_See code: [lib/commands/simply/cicd/deploy/project/pre-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/pre-destructive.js)_
|
|
1370
1382
|
|
|
1371
1383
|
## `sf simply cicd deploy project run-apex-tests`
|
|
1372
1384
|
|
|
@@ -1413,7 +1425,7 @@ EXAMPLES
|
|
|
1413
1425
|
$ sf simply cicd deploy project run-apex-tests --ci-job-token $CI_JOB_TOKEN --alias my-org
|
|
1414
1426
|
```
|
|
1415
1427
|
|
|
1416
|
-
_See code: [lib/commands/simply/cicd/deploy/project/run-apex-tests.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1428
|
+
_See code: [lib/commands/simply/cicd/deploy/project/run-apex-tests.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/run-apex-tests.js)_
|
|
1417
1429
|
|
|
1418
1430
|
## `sf simply cicd deploy project validate`
|
|
1419
1431
|
|
|
@@ -1448,7 +1460,7 @@ EXAMPLES
|
|
|
1448
1460
|
$ sf simply cicd deploy project validate --deploy-config-file config/deploy.json --deploy-rules-file config/deploy-rules.json
|
|
1449
1461
|
```
|
|
1450
1462
|
|
|
1451
|
-
_See code: [lib/commands/simply/cicd/deploy/project/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1463
|
+
_See code: [lib/commands/simply/cicd/deploy/project/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/validate.js)_
|
|
1452
1464
|
|
|
1453
1465
|
## `sf simply cicd deploy validate`
|
|
1454
1466
|
|
|
@@ -1482,7 +1494,7 @@ EXAMPLES
|
|
|
1482
1494
|
$ sf simply cicd deploy validate --deploy-config-file config/deploy.json --deploy-rules-file config/deploy-rules.json
|
|
1483
1495
|
```
|
|
1484
1496
|
|
|
1485
|
-
_See code: [lib/commands/simply/cicd/deploy/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1497
|
+
_See code: [lib/commands/simply/cicd/deploy/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/validate.js)_
|
|
1486
1498
|
|
|
1487
1499
|
## `sf simply cicd notify build`
|
|
1488
1500
|
|
|
@@ -1558,7 +1570,7 @@ EXAMPLES
|
|
|
1558
1570
|
--teams-webhook-url https://outlook.office.com/webhook/... --enabled
|
|
1559
1571
|
```
|
|
1560
1572
|
|
|
1561
|
-
_See code: [lib/commands/simply/cicd/notify/build.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1573
|
+
_See code: [lib/commands/simply/cicd/notify/build.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/notify/build.js)_
|
|
1562
1574
|
|
|
1563
1575
|
## `sf simply cicd notify happy-soup`
|
|
1564
1576
|
|
|
@@ -1631,7 +1643,7 @@ EXAMPLES
|
|
|
1631
1643
|
$ sf simply cicd notify happy-soup --after-script --is-final-job --notify-on-completion --ci-job-status success --teams-webhook-url https://outlook.office.com/webhook/... --enabled
|
|
1632
1644
|
```
|
|
1633
1645
|
|
|
1634
|
-
_See code: [lib/commands/simply/cicd/notify/happy-soup.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1646
|
+
_See code: [lib/commands/simply/cicd/notify/happy-soup.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/notify/happy-soup.js)_
|
|
1635
1647
|
|
|
1636
1648
|
## `sf simply cicd notify project`
|
|
1637
1649
|
|
|
@@ -1705,7 +1717,7 @@ EXAMPLES
|
|
|
1705
1717
|
$ sf simply cicd notify project --after-script --ci-job-stage post-destructive --ci-job-status success --teams-webhook-url https://outlook.office.com/webhook/... --enabled
|
|
1706
1718
|
```
|
|
1707
1719
|
|
|
1708
|
-
_See code: [lib/commands/simply/cicd/notify/project.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1720
|
+
_See code: [lib/commands/simply/cicd/notify/project.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/notify/project.js)_
|
|
1709
1721
|
|
|
1710
1722
|
## `sf simply cicd notify teams`
|
|
1711
1723
|
|
|
@@ -1737,7 +1749,7 @@ EXAMPLES
|
|
|
1737
1749
|
$ sf simply cicd notify teams --payload '{"text":"Deployment complete"}' --webhook-url https://outlook.office.com/webhook/... --enabled
|
|
1738
1750
|
```
|
|
1739
1751
|
|
|
1740
|
-
_See code: [lib/commands/simply/cicd/notify/teams.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1752
|
+
_See code: [lib/commands/simply/cicd/notify/teams.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/notify/teams.js)_
|
|
1741
1753
|
|
|
1742
1754
|
## `sf simply cicd sfdx-dependabot`
|
|
1743
1755
|
|
|
@@ -1813,7 +1825,7 @@ FLAG DESCRIPTIONS
|
|
|
1813
1825
|
Defaults to the selected provider's public instance if not provided.
|
|
1814
1826
|
```
|
|
1815
1827
|
|
|
1816
|
-
_See code: [lib/commands/simply/cicd/sfdx-dependabot.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1828
|
+
_See code: [lib/commands/simply/cicd/sfdx-dependabot.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.17.0/packages/simply-cicd/lib/commands/simply/cicd/sfdx-dependabot.js)_
|
|
1817
1829
|
<!-- commandsstop -->
|
|
1818
1830
|
|
|
1819
1831
|
## License
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
2
|
import { type RunLwcJestResult } from '../../../../common/build/lwcJest.js';
|
|
3
|
-
/** Installs the LWC Jest test libraries and runs the project's LWC Jest tests with coverage. */
|
|
3
|
+
/** Installs the LWC Jest test libraries and runs the project's LWC Jest tests with coverage and a JUnit report. */
|
|
4
4
|
export default class BuildLwcJest extends SfCommand<RunLwcJestResult> {
|
|
5
5
|
static readonly summary: string;
|
|
6
6
|
static readonly description: string;
|
|
7
7
|
static readonly examples: string[];
|
|
8
8
|
static readonly flags: {
|
|
9
|
+
'lwc-jest-fail-on-test-failure': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
10
|
disabled: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Messages } from '@salesforce/core';
|
|
17
|
-
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
17
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
18
18
|
import { runLwcJest } from '../../../../common/build/lwcJest.js';
|
|
19
19
|
import { debugFlag, disabledFlag } from '../../../../common/build/flags.js';
|
|
20
20
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
21
21
|
const messages = Messages.loadMessages('@simplysf/simply-cicd', 'simply.cicd.build.lwc-jest');
|
|
22
|
-
/** Installs the LWC Jest test libraries and runs the project's LWC Jest tests with coverage. */
|
|
22
|
+
/** Installs the LWC Jest test libraries and runs the project's LWC Jest tests with coverage and a JUnit report. */
|
|
23
23
|
export default class BuildLwcJest extends SfCommand {
|
|
24
24
|
static summary = messages.getMessage('summary');
|
|
25
25
|
static description = messages.getMessage('description');
|
|
@@ -28,10 +28,15 @@ export default class BuildLwcJest extends SfCommand {
|
|
|
28
28
|
...SfCommand.baseFlags,
|
|
29
29
|
...debugFlag,
|
|
30
30
|
...disabledFlag,
|
|
31
|
+
'lwc-jest-fail-on-test-failure': Flags.boolean({
|
|
32
|
+
summary: messages.getMessage('flags.lwc-jest-fail-on-test-failure.summary'),
|
|
33
|
+
default: false,
|
|
34
|
+
env: 'SIMPLY_CICD_LWC_JEST_FAIL_ON_TEST_FAILURE',
|
|
35
|
+
}),
|
|
31
36
|
};
|
|
32
37
|
async run() {
|
|
33
38
|
const { flags } = await this.parse(BuildLwcJest);
|
|
34
|
-
return runLwcJest({ disabled: flags.disabled });
|
|
39
|
+
return runLwcJest({ disabled: flags.disabled, failOnTestFailure: flags['lwc-jest-fail-on-test-failure'] });
|
|
35
40
|
}
|
|
36
41
|
}
|
|
37
42
|
//# sourceMappingURL=lwc-jest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lwc-jest.js","sourceRoot":"","sources":["../../../../../src/commands/simply/cicd/build/lwc-jest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"lwc-jest.js","sourceRoot":"","sources":["../../../../../src/commands/simply/cicd/build/lwc-jest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAyB,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAE5E,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,uBAAuB,EAAE,4BAA4B,CAAC,CAAC;AAE9F,mHAAmH;AACnH,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,SAA2B;IAC5D,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAE5D,MAAM,CAAU,KAAK,GAAG;QAC7B,GAAG,SAAS,CAAC,SAAS;QACtB,GAAG,SAAS;QACZ,GAAG,YAAY;QACf,+BAA+B,EAAE,KAAK,CAAC,OAAO,CAAC;YAC7C,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,6CAA6C,CAAC;YAC3E,OAAO,EAAE,KAAK;YACd,GAAG,EAAE,2CAA2C;SACjD,CAAC;KACH,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAEjD,OAAO,UAAU,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,iBAAiB,EAAE,KAAK,CAAC,+BAA+B,CAAC,EAAE,CAAC,CAAC;IAC7G,CAAC"}
|
|
@@ -1,9 +1,25 @@
|
|
|
1
|
+
/** Where `runLwcJest` writes the JUnit report, mirroring `runApexTests`'s `./test-results/apex`. */
|
|
2
|
+
export declare const LWC_JEST_RESULTS_DIR = "./test-results/lwc";
|
|
3
|
+
export declare const LWC_JEST_RESULTS_FILE = "test-result.xml";
|
|
1
4
|
export type RunLwcJestOptions = {
|
|
2
5
|
disabled?: boolean;
|
|
6
|
+
failOnTestFailure?: boolean;
|
|
7
|
+
projectDir?: string;
|
|
3
8
|
};
|
|
4
9
|
export type RunLwcJestResult = {
|
|
5
10
|
skipped: boolean;
|
|
6
11
|
success: boolean;
|
|
7
12
|
};
|
|
8
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Builds an ES module Jest config that loads the project's own config and adds `jest-junit` to its
|
|
15
|
+
* reporters, rather than replacing them the way a CLI `--reporters` would. `rootDir` is pinned to the
|
|
16
|
+
* project, since Jest would otherwise default it to the wrapper's own (temporary) directory.
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildJunitJestConfig(projectConfigFile: string, projectDir: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Installs the LWC Jest test libraries and runs the project's LWC Jest tests with coverage, writing
|
|
21
|
+
* a JUnit report to `./test-results/lwc/test-result.xml` alongside any reporters the project's own
|
|
22
|
+
* Jest config sets. A failure is logged and returned, unless `failOnTestFailure` is set, in which
|
|
23
|
+
* case it also throws.
|
|
24
|
+
*/
|
|
9
25
|
export declare function runLwcJest(options: RunLwcJestOptions): Promise<RunLwcJestResult>;
|
|
@@ -13,24 +13,114 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { promises as fs } from 'node:fs';
|
|
17
|
+
import os from 'node:os';
|
|
18
|
+
import path from 'node:path';
|
|
19
|
+
import { pathToFileURL } from 'node:url';
|
|
16
20
|
import { execa } from 'execa';
|
|
17
21
|
import { logger } from '../logger.js';
|
|
18
|
-
/**
|
|
22
|
+
/** Where `runLwcJest` writes the JUnit report, mirroring `runApexTests`'s `./test-results/apex`. */
|
|
23
|
+
export const LWC_JEST_RESULTS_DIR = './test-results/lwc';
|
|
24
|
+
export const LWC_JEST_RESULTS_FILE = 'test-result.xml';
|
|
25
|
+
/** The project config files `sfdx-lwc-jest` recognizes; with none present it passes its own default `--config`. */
|
|
26
|
+
const PROJECT_JEST_CONFIG_FILES = ['jest.config.js', 'jest.config.mjs', 'jest.config.cjs'];
|
|
27
|
+
async function findProjectJestConfig(projectDir) {
|
|
28
|
+
for (const file of PROJECT_JEST_CONFIG_FILES) {
|
|
29
|
+
const configPath = path.join(projectDir, file);
|
|
30
|
+
try {
|
|
31
|
+
// eslint-disable-next-line no-await-in-loop -- first match wins, in sfdx-lwc-jest's order
|
|
32
|
+
await fs.access(configPath);
|
|
33
|
+
return configPath;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
// not present; try the next name
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Builds an ES module Jest config that loads the project's own config and adds `jest-junit` to its
|
|
43
|
+
* reporters, rather than replacing them the way a CLI `--reporters` would. `rootDir` is pinned to the
|
|
44
|
+
* project, since Jest would otherwise default it to the wrapper's own (temporary) directory.
|
|
45
|
+
*/
|
|
46
|
+
export function buildJunitJestConfig(projectConfigFile, projectDir) {
|
|
47
|
+
// A config function rather than top-level await: Jest loads config files with require() first, and
|
|
48
|
+
// require() can't load an ES module that uses top-level await.
|
|
49
|
+
return `import path from 'node:path';
|
|
50
|
+
|
|
51
|
+
export default async () => {
|
|
52
|
+
const mod = await import(${JSON.stringify(pathToFileURL(projectConfigFile).href)});
|
|
53
|
+
let config = mod.default ?? mod;
|
|
54
|
+
if (typeof config === 'function') {
|
|
55
|
+
config = await config();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const reporters = config.reporters ?? ['default'];
|
|
59
|
+
const hasJunit = reporters.some((reporter) => (Array.isArray(reporter) ? reporter[0] : reporter) === 'jest-junit');
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
...config,
|
|
63
|
+
rootDir: path.resolve(${JSON.stringify(projectDir)}, config.rootDir ?? '.'),
|
|
64
|
+
reporters: hasJunit ? reporters : [...reporters, 'jest-junit'],
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
`;
|
|
68
|
+
}
|
|
69
|
+
function failRun(options, message, error) {
|
|
70
|
+
logger.error(message);
|
|
71
|
+
if (options.failOnTestFailure) {
|
|
72
|
+
throw new Error(message, { cause: error });
|
|
73
|
+
}
|
|
74
|
+
return { skipped: false, success: false };
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Installs the LWC Jest test libraries and runs the project's LWC Jest tests with coverage, writing
|
|
78
|
+
* a JUnit report to `./test-results/lwc/test-result.xml` alongside any reporters the project's own
|
|
79
|
+
* Jest config sets. A failure is logged and returned, unless `failOnTestFailure` is set, in which
|
|
80
|
+
* case it also throws.
|
|
81
|
+
*/
|
|
19
82
|
export async function runLwcJest(options) {
|
|
20
83
|
if (options.disabled) {
|
|
21
84
|
logger.warn('lwc-jest is disabled. Skipping.');
|
|
22
85
|
return { skipped: true, success: false };
|
|
23
86
|
}
|
|
87
|
+
const projectDir = options.projectDir ?? process.cwd();
|
|
24
88
|
logger.info('Running LWC Jest tests...');
|
|
89
|
+
// Created up front so a pipeline's `when: always` artifact path exists even if Jest never starts.
|
|
90
|
+
await fs.mkdir(path.join(projectDir, LWC_JEST_RESULTS_DIR), { recursive: true });
|
|
25
91
|
try {
|
|
26
|
-
await execa('npm', ['install', '@salesforce/sfdx-lwc-jest', '@sa11y/jest'
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
92
|
+
await execa('npm', ['install', '@salesforce/sfdx-lwc-jest', '@sa11y/jest', 'jest-junit'], {
|
|
93
|
+
cwd: projectDir,
|
|
94
|
+
stdio: 'pipe',
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
return failRun(options, 'Failed to install the LWC Jest test libraries.', error);
|
|
99
|
+
}
|
|
100
|
+
const projectConfig = await findProjectJestConfig(projectDir);
|
|
101
|
+
const wrapperDir = projectConfig ? await fs.mkdtemp(path.join(os.tmpdir(), 'lwc-jest-')) : undefined;
|
|
102
|
+
try {
|
|
103
|
+
let reporterArgs = ['--reporters=default', '--reporters=jest-junit'];
|
|
104
|
+
if (projectConfig && wrapperDir) {
|
|
105
|
+
const wrapperConfig = path.join(wrapperDir, 'jest.config.mjs');
|
|
106
|
+
await fs.writeFile(wrapperConfig, buildJunitJestConfig(projectConfig, projectDir));
|
|
107
|
+
reporterArgs = [`--config=${wrapperConfig}`];
|
|
108
|
+
}
|
|
109
|
+
await execa('npx', ['sfdx-lwc-jest', '--coverage', '--', '--passWithNoTests', ...reporterArgs], {
|
|
110
|
+
cwd: projectDir,
|
|
111
|
+
stdio: 'inherit',
|
|
112
|
+
env: { JEST_JUNIT_OUTPUT_DIR: LWC_JEST_RESULTS_DIR, JEST_JUNIT_OUTPUT_NAME: LWC_JEST_RESULTS_FILE },
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
return failRun(options, 'LWC Jest tests failed.', error);
|
|
30
117
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
118
|
+
finally {
|
|
119
|
+
if (wrapperDir) {
|
|
120
|
+
await fs.rm(wrapperDir, { recursive: true, force: true });
|
|
121
|
+
}
|
|
34
122
|
}
|
|
123
|
+
logger.success('LWC Jest tests completed.');
|
|
124
|
+
return { skipped: false, success: true };
|
|
35
125
|
}
|
|
36
126
|
//# sourceMappingURL=lwcJest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lwcJest.js","sourceRoot":"","sources":["../../../src/common/build/lwcJest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"lwcJest.js","sourceRoot":"","sources":["../../../src/common/build/lwcJest.ts"],"names":[],"mappings":"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"}
|
|
@@ -4,8 +4,16 @@ Install the LWC Jest test libraries and run the project's LWC Jest tests with co
|
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
Installs `@salesforce/sfdx-lwc-jest
|
|
7
|
+
Installs `@salesforce/sfdx-lwc-jest`, `@sa11y/jest`, and `jest-junit`, then runs `sfdx-lwc-jest --coverage -- --passWithNoTests` with the `jest-junit` reporter added to any reporters the project's own Jest config sets, writing a JUnit report to `./test-results/lwc/test-result.xml` for the pipeline to upload as an artifact. By default failures are logged, not thrown, so they don't fail the pipeline; pass `--lwc-jest-fail-on-test-failure` to make them exit non-zero.
|
|
8
|
+
|
|
9
|
+
# flags.lwc-jest-fail-on-test-failure.summary
|
|
10
|
+
|
|
11
|
+
Exit non-zero when the LWC Jest tests (or their install) fail, failing the pipeline. By default failures are only logged.
|
|
8
12
|
|
|
9
13
|
# examples
|
|
10
14
|
|
|
11
15
|
- <%= config.bin %> <%= command.id %>
|
|
16
|
+
|
|
17
|
+
- Fail the pipeline when a test fails:
|
|
18
|
+
|
|
19
|
+
<%= config.bin %> <%= command.id %> --lwc-jest-fail-on-test-failure
|