@rstest/core 0.8.0 → 0.8.1
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/LICENSE.md +0 -200
- package/dist/0~130.js +7 -9
- package/dist/0~1472.js +8 -12
- package/dist/0~2173.js +39 -43
- package/dist/0~2255.js +1 -1
- package/dist/0~3919.js +1 -1
- package/dist/0~4403.js +1 -2
- package/dist/0~5835.js +2 -2
- package/dist/0~6588.js +3 -6
- package/dist/0~6923.js +2 -2
- package/dist/0~7583.js +6 -7
- package/dist/0~7882.js +35 -151
- package/dist/0~8426.js +5 -7
- package/dist/0~89.js +10 -12
- package/dist/0~9348.js +1 -2
- package/dist/0~9634.js +2 -5
- package/dist/1157.js +126 -40
- package/dist/1157.js.LICENSE.txt +21 -0
- package/dist/1294.js +1 -1
- package/dist/{2672.js → 3160.js} +309 -5
- package/dist/487.js +1 -1
- package/dist/5734.js +2 -5
- package/dist/6151.js +198 -3
- package/dist/6973.js +4 -6
- package/dist/7011.js +19 -0
- package/dist/9131.js +80 -59
- package/dist/browser-runtime/389.js +615 -13
- package/dist/browser-runtime/389.js.map +1 -1
- package/dist/browser-runtime/index.d.ts +163 -7
- package/dist/browser.d.ts +168 -9
- package/dist/browser.js +1 -7
- package/dist/globalSetupWorker.js +2 -4
- package/dist/index.d.ts +174 -7
- package/dist/mockRuntimeCode.js +92 -0
- package/dist/rslib-runtime.js +0 -27
- package/dist/worker.js +2 -4
- package/package.json +2 -3
- package/dist/3278.js +0 -318
package/LICENSE.md
CHANGED
|
@@ -536,206 +536,6 @@ Licensed under BSD-3-Clause license in the repository at git+https://github.com/
|
|
|
536
536
|
>
|
|
537
537
|
> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
538
538
|
|
|
539
|
-
### @vercel/detect-agent
|
|
540
|
-
|
|
541
|
-
Licensed under Apache-2.0 license in the repository at https://github.com/vercel/vercel.git.
|
|
542
|
-
|
|
543
|
-
> Apache License
|
|
544
|
-
> Version 2.0, January 2004
|
|
545
|
-
> http://www.apache.org/licenses/
|
|
546
|
-
>
|
|
547
|
-
> TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
548
|
-
>
|
|
549
|
-
> 1. Definitions.
|
|
550
|
-
>
|
|
551
|
-
> "License" shall mean the terms and conditions for use, reproduction,
|
|
552
|
-
> and distribution as defined by Sections 1 through 9 of this document.
|
|
553
|
-
>
|
|
554
|
-
> "Licensor" shall mean the copyright owner or entity authorized by
|
|
555
|
-
> the copyright owner that is granting the License.
|
|
556
|
-
>
|
|
557
|
-
> "Legal Entity" shall mean the union of the acting entity and all
|
|
558
|
-
> other entities that control, are controlled by, or are under common
|
|
559
|
-
> control with that entity. For the purposes of this definition,
|
|
560
|
-
> "control" means (i) the power, direct or indirect, to cause the
|
|
561
|
-
> direction or management of such entity, whether by contract or
|
|
562
|
-
> otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
563
|
-
> outstanding shares, or (iii) beneficial ownership of such entity.
|
|
564
|
-
>
|
|
565
|
-
> "You" (or "Your") shall mean an individual or Legal Entity
|
|
566
|
-
> exercising permissions granted by this License.
|
|
567
|
-
>
|
|
568
|
-
> "Source" form shall mean the preferred form for making modifications,
|
|
569
|
-
> including but not limited to software source code, documentation
|
|
570
|
-
> source, and configuration files.
|
|
571
|
-
>
|
|
572
|
-
> "Object" form shall mean any form resulting from mechanical
|
|
573
|
-
> transformation or translation of a Source form, including but
|
|
574
|
-
> not limited to compiled object code, generated documentation,
|
|
575
|
-
> and conversions to other media types.
|
|
576
|
-
>
|
|
577
|
-
> "Work" shall mean the work of authorship, whether in Source or
|
|
578
|
-
> Object form, made available under the License, as indicated by a
|
|
579
|
-
> copyright notice that is included in or attached to the work
|
|
580
|
-
> (an example is provided in the Appendix below).
|
|
581
|
-
>
|
|
582
|
-
> "Derivative Works" shall mean any work, whether in Source or Object
|
|
583
|
-
> form, that is based on (or derived from) the Work and for which the
|
|
584
|
-
> editorial revisions, annotations, elaborations, or other modifications
|
|
585
|
-
> represent, as a whole, an original work of authorship. For the purposes
|
|
586
|
-
> of this License, Derivative Works shall not include works that remain
|
|
587
|
-
> separable from, or merely link (or bind by name) to the interfaces of,
|
|
588
|
-
> the Work and Derivative Works thereof.
|
|
589
|
-
>
|
|
590
|
-
> "Contribution" shall mean any work of authorship, including
|
|
591
|
-
> the original version of the Work and any modifications or additions
|
|
592
|
-
> to that Work or Derivative Works thereof, that is intentionally
|
|
593
|
-
> submitted to Licensor for inclusion in the Work by the copyright owner
|
|
594
|
-
> or by an individual or Legal Entity authorized to submit on behalf of
|
|
595
|
-
> the copyright owner. For the purposes of this definition, "submitted"
|
|
596
|
-
> means any form of electronic, verbal, or written communication sent
|
|
597
|
-
> to the Licensor or its representatives, including but not limited to
|
|
598
|
-
> communication on electronic mailing lists, source code control systems,
|
|
599
|
-
> and issue tracking systems that are managed by, or on behalf of, the
|
|
600
|
-
> Licensor for the purpose of discussing and improving the Work, but
|
|
601
|
-
> excluding communication that is conspicuously marked or otherwise
|
|
602
|
-
> designated in writing by the copyright owner as "Not a Contribution."
|
|
603
|
-
>
|
|
604
|
-
> "Contributor" shall mean Licensor and any individual or Legal Entity
|
|
605
|
-
> on behalf of whom a Contribution has been received by Licensor and
|
|
606
|
-
> subsequently incorporated within the Work.
|
|
607
|
-
>
|
|
608
|
-
> 2. Grant of Copyright License. Subject to the terms and conditions of
|
|
609
|
-
> this License, each Contributor hereby grants to You a perpetual,
|
|
610
|
-
> worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
611
|
-
> copyright license to reproduce, prepare Derivative Works of,
|
|
612
|
-
> publicly display, publicly perform, sublicense, and distribute the
|
|
613
|
-
> Work and such Derivative Works in Source or Object form.
|
|
614
|
-
> 3. Grant of Patent License. Subject to the terms and conditions of
|
|
615
|
-
> this License, each Contributor hereby grants to You a perpetual,
|
|
616
|
-
> worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
617
|
-
> (except as stated in this section) patent license to make, have made,
|
|
618
|
-
> use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
619
|
-
> where such license applies only to those patent claims licensable
|
|
620
|
-
> by such Contributor that are necessarily infringed by their
|
|
621
|
-
> Contribution(s) alone or by combination of their Contribution(s)
|
|
622
|
-
> with the Work to which such Contribution(s) was submitted. If You
|
|
623
|
-
> institute patent litigation against any entity (including a
|
|
624
|
-
> cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
625
|
-
> or a Contribution incorporated within the Work constitutes direct
|
|
626
|
-
> or contributory patent infringement, then any patent licenses
|
|
627
|
-
> granted to You under this License for that Work shall terminate
|
|
628
|
-
> as of the date such litigation is filed.
|
|
629
|
-
> 4. Redistribution. You may reproduce and distribute copies of the
|
|
630
|
-
> Work or Derivative Works thereof in any medium, with or without
|
|
631
|
-
> modifications, and in Source or Object form, provided that You
|
|
632
|
-
> meet the following conditions:
|
|
633
|
-
>
|
|
634
|
-
> (a) You must give any other recipients of the Work or
|
|
635
|
-
> Derivative Works a copy of this License; and
|
|
636
|
-
>
|
|
637
|
-
> (b) You must cause any modified files to carry prominent notices
|
|
638
|
-
> stating that You changed the files; and
|
|
639
|
-
>
|
|
640
|
-
> (c) You must retain, in the Source form of any Derivative Works
|
|
641
|
-
> that You distribute, all copyright, patent, trademark, and
|
|
642
|
-
> attribution notices from the Source form of the Work,
|
|
643
|
-
> excluding those notices that do not pertain to any part of
|
|
644
|
-
> the Derivative Works; and
|
|
645
|
-
>
|
|
646
|
-
> (d) If the Work includes a "NOTICE" text file as part of its
|
|
647
|
-
> distribution, then any Derivative Works that You distribute must
|
|
648
|
-
> include a readable copy of the attribution notices contained
|
|
649
|
-
> within such NOTICE file, excluding those notices that do not
|
|
650
|
-
> pertain to any part of the Derivative Works, in at least one
|
|
651
|
-
> of the following places: within a NOTICE text file distributed
|
|
652
|
-
> as part of the Derivative Works; within the Source form or
|
|
653
|
-
> documentation, if provided along with the Derivative Works; or,
|
|
654
|
-
> within a display generated by the Derivative Works, if and
|
|
655
|
-
> wherever such third-party notices normally appear. The contents
|
|
656
|
-
> of the NOTICE file are for informational purposes only and
|
|
657
|
-
> do not modify the License. You may add Your own attribution
|
|
658
|
-
> notices within Derivative Works that You distribute, alongside
|
|
659
|
-
> or as an addendum to the NOTICE text from the Work, provided
|
|
660
|
-
> that such additional attribution notices cannot be construed
|
|
661
|
-
> as modifying the License.
|
|
662
|
-
>
|
|
663
|
-
> You may add Your own copyright statement to Your modifications and
|
|
664
|
-
> may provide additional or different license terms and conditions
|
|
665
|
-
> for use, reproduction, or distribution of Your modifications, or
|
|
666
|
-
> for any such Derivative Works as a whole, provided Your use,
|
|
667
|
-
> reproduction, and distribution of the Work otherwise complies with
|
|
668
|
-
> the conditions stated in this License.
|
|
669
|
-
>
|
|
670
|
-
> 5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
671
|
-
> any Contribution intentionally submitted for inclusion in the Work
|
|
672
|
-
> by You to the Licensor shall be under the terms and conditions of
|
|
673
|
-
> this License, without any additional terms or conditions.
|
|
674
|
-
> Notwithstanding the above, nothing herein shall supersede or modify
|
|
675
|
-
> the terms of any separate license agreement you may have executed
|
|
676
|
-
> with Licensor regarding such Contributions.
|
|
677
|
-
> 6. Trademarks. This License does not grant permission to use the trade
|
|
678
|
-
> names, trademarks, service marks, or product names of the Licensor,
|
|
679
|
-
> except as required for reasonable and customary use in describing the
|
|
680
|
-
> origin of the Work and reproducing the content of the NOTICE file.
|
|
681
|
-
> 7. Disclaimer of Warranty. Unless required by applicable law or
|
|
682
|
-
> agreed to in writing, Licensor provides the Work (and each
|
|
683
|
-
> Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
684
|
-
> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
685
|
-
> implied, including, without limitation, any warranties or conditions
|
|
686
|
-
> of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
687
|
-
> PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
688
|
-
> appropriateness of using or redistributing the Work and assume any
|
|
689
|
-
> risks associated with Your exercise of permissions under this License.
|
|
690
|
-
> 8. Limitation of Liability. In no event and under no legal theory,
|
|
691
|
-
> whether in tort (including negligence), contract, or otherwise,
|
|
692
|
-
> unless required by applicable law (such as deliberate and grossly
|
|
693
|
-
> negligent acts) or agreed to in writing, shall any Contributor be
|
|
694
|
-
> liable to You for damages, including any direct, indirect, special,
|
|
695
|
-
> incidental, or consequential damages of any character arising as a
|
|
696
|
-
> result of this License or out of the use or inability to use the
|
|
697
|
-
> Work (including but not limited to damages for loss of goodwill,
|
|
698
|
-
> work stoppage, computer failure or malfunction, or any and all
|
|
699
|
-
> other commercial damages or losses), even if such Contributor
|
|
700
|
-
> has been advised of the possibility of such damages.
|
|
701
|
-
> 9. Accepting Warranty or Additional Liability. While redistributing
|
|
702
|
-
> the Work or Derivative Works thereof, You may choose to offer,
|
|
703
|
-
> and charge a fee for, acceptance of support, warranty, indemnity,
|
|
704
|
-
> or other liability obligations and/or rights consistent with this
|
|
705
|
-
> License. However, in accepting such obligations, You may act only
|
|
706
|
-
> on Your own behalf and on Your sole responsibility, not on behalf
|
|
707
|
-
> of any other Contributor, and only if You agree to indemnify,
|
|
708
|
-
> defend, and hold each Contributor harmless for any liability
|
|
709
|
-
> incurred by, or claims asserted against, such Contributor by reason
|
|
710
|
-
> of your accepting any such warranty or additional liability.
|
|
711
|
-
>
|
|
712
|
-
> END OF TERMS AND CONDITIONS
|
|
713
|
-
>
|
|
714
|
-
> APPENDIX: How to apply the Apache License to your work.
|
|
715
|
-
>
|
|
716
|
-
> To apply the Apache License to your work, attach the following
|
|
717
|
-
> boilerplate notice, with the fields enclosed by brackets "[]"
|
|
718
|
-
> replaced with your own identifying information. (Don't include
|
|
719
|
-
> the brackets!) The text should be enclosed in the appropriate
|
|
720
|
-
> comment syntax for the file format. We also recommend that a
|
|
721
|
-
> file or class name and description of purpose be included on the
|
|
722
|
-
> same "printed page" as the copyright notice for easier
|
|
723
|
-
> identification within third-party archives.
|
|
724
|
-
>
|
|
725
|
-
> Copyright 2017 Vercel, Inc.
|
|
726
|
-
>
|
|
727
|
-
> Licensed under the Apache License, Version 2.0 (the "License");
|
|
728
|
-
> you may not use this file except in compliance with the License.
|
|
729
|
-
> You may obtain a copy of the License at
|
|
730
|
-
>
|
|
731
|
-
> http://www.apache.org/licenses/LICENSE-2.0
|
|
732
|
-
>
|
|
733
|
-
> Unless required by applicable law or agreed to in writing, software
|
|
734
|
-
> distributed under the License is distributed on an "AS IS" BASIS,
|
|
735
|
-
> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
736
|
-
> See the License for the specific language governing permissions and
|
|
737
|
-
> limitations under the License.
|
|
738
|
-
|
|
739
539
|
### @vitest/expect
|
|
740
540
|
|
|
741
541
|
Licensed under MIT license in the repository at git+https://github.com/vitest-dev/vitest.git.
|
package/dist/0~130.js
CHANGED
|
@@ -4,10 +4,8 @@ import { __webpack_require__ } from "./rslib-runtime.js";
|
|
|
4
4
|
import { AssertionError, strict } from "node:assert";
|
|
5
5
|
import { Console } from "node:console";
|
|
6
6
|
import "./721.js";
|
|
7
|
-
import { prettyTime } from "./
|
|
7
|
+
import { prettyTime, color } from "./3160.js";
|
|
8
8
|
const external_node_util_ = __webpack_require__("node:util");
|
|
9
|
-
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
10
|
-
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
11
9
|
const RealDate = Date;
|
|
12
10
|
function createCustomConsole({ rpc, testPath, printConsoleTrace }) {
|
|
13
11
|
const getConsoleTrace = ()=>{
|
|
@@ -26,13 +24,13 @@ function createCustomConsole({ rpc, testPath, printConsoleTrace }) {
|
|
|
26
24
|
getPrettyName(type) {
|
|
27
25
|
switch(type){
|
|
28
26
|
case 'error':
|
|
29
|
-
return
|
|
27
|
+
return color.red(type);
|
|
30
28
|
case 'warn':
|
|
31
|
-
return
|
|
29
|
+
return color.yellow(type);
|
|
32
30
|
case 'info':
|
|
33
|
-
return
|
|
31
|
+
return color.cyan(type);
|
|
34
32
|
default:
|
|
35
|
-
return
|
|
33
|
+
return color.gray(type);
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
36
|
_log(name, message, type = 'stdout') {
|
|
@@ -74,11 +72,11 @@ function createCustomConsole({ rpc, testPath, printConsoleTrace }) {
|
|
|
74
72
|
}
|
|
75
73
|
group(title, ...args) {
|
|
76
74
|
this._groupDepth++;
|
|
77
|
-
if (null != title || args.length > 0) this._log('group',
|
|
75
|
+
if (null != title || args.length > 0) this._log('group', color.bold((0, external_node_util_.format)(title, ...args)));
|
|
78
76
|
}
|
|
79
77
|
groupCollapsed(title, ...args) {
|
|
80
78
|
this._groupDepth++;
|
|
81
|
-
if (null != title || args.length > 0) this._log('groupCollapsed',
|
|
79
|
+
if (null != title || args.length > 0) this._log('groupCollapsed', color.bold((0, external_node_util_.format)(title, ...args)));
|
|
82
80
|
}
|
|
83
81
|
groupEnd() {
|
|
84
82
|
if (this._groupDepth > 0) this._groupDepth--;
|
package/dist/0~1472.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
4
|
-
import "./2672.js";
|
|
5
3
|
import { createRequire } from "./4881.js";
|
|
6
4
|
import { pathToFileURL } from "./6198.js";
|
|
7
5
|
import "./1157.js";
|
|
8
|
-
import { logger as logger_logger } from "./
|
|
9
|
-
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
10
|
-
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
6
|
+
import { logger as logger_logger, color } from "./3160.js";
|
|
11
7
|
async function loadBrowserModule(options = {}) {
|
|
12
|
-
const coreVersion = "0.8.
|
|
8
|
+
const coreVersion = "0.8.1";
|
|
13
9
|
const { projectRoots = [] } = options;
|
|
14
10
|
let browserModule;
|
|
15
11
|
let browserVersion;
|
|
@@ -29,9 +25,9 @@ async function loadBrowserModule(options = {}) {
|
|
|
29
25
|
const browserPkg = userRequire(browserPkgPath);
|
|
30
26
|
browserVersion = browserPkg.version;
|
|
31
27
|
if (browserVersion !== coreVersion) {
|
|
32
|
-
logger_logger.error(`\n${
|
|
33
|
-
logger_logger.error(` @rstest/core version: ${
|
|
34
|
-
logger_logger.error(`Please ensure both packages have the same version:\n\n ${
|
|
28
|
+
logger_logger.error(`\n${color.red('Error:')} Version mismatch between ${color.cyan('@rstest/core')} and ${color.cyan('@rstest/browser')}.\n`);
|
|
29
|
+
logger_logger.error(` @rstest/core version: ${color.yellow(coreVersion)}\n @rstest/browser version: ${color.yellow(browserVersion)}\n`);
|
|
30
|
+
logger_logger.error(`Please ensure both packages have the same version:\n\n ${color.cyan(`npm install @rstest/browser@${coreVersion}`)}\n`);
|
|
35
31
|
process.exit(1);
|
|
36
32
|
}
|
|
37
33
|
return browserModule;
|
|
@@ -40,9 +36,9 @@ async function loadBrowserModule(options = {}) {
|
|
|
40
36
|
if ('ERR_MODULE_NOT_FOUND' === err.code || 'MODULE_NOT_FOUND' === err.code) continue;
|
|
41
37
|
throw error;
|
|
42
38
|
}
|
|
43
|
-
logger_logger.error(`\n${
|
|
44
|
-
logger_logger.error(`Please install it with:\n\n ${
|
|
45
|
-
logger_logger.error(`Or if using pnpm:\n\n ${
|
|
39
|
+
logger_logger.error(`\n${color.red('Error:')} Browser mode requires ${color.cyan('@rstest/browser')} to be installed.\n`);
|
|
40
|
+
logger_logger.error(`Please install it with:\n\n ${color.cyan(`npm install @rstest/browser@${coreVersion}`)}\n`);
|
|
41
|
+
logger_logger.error(`Or if using pnpm:\n\n ${color.cyan(`pnpm add @rstest/browser@${coreVersion}`)}\n`);
|
|
46
42
|
process.exit(1);
|
|
47
43
|
}
|
|
48
44
|
export { loadBrowserModule };
|
package/dist/0~2173.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
4
|
-
import { isTTY } from "./2672.js";
|
|
5
3
|
import { getTestEntries } from "./1157.js";
|
|
6
4
|
import { createCoverageProvider } from "./5734.js";
|
|
7
5
|
import { prepareRsbuild, createPool, createRsbuildServer, runGlobalTeardown, runGlobalSetup } from "./0~89.js";
|
|
8
6
|
import { loadBrowserModule } from "./0~1472.js";
|
|
9
|
-
import {
|
|
10
|
-
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
11
|
-
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
7
|
+
import { logger as logger_logger, isTTY, color, clearScreen } from "./3160.js";
|
|
12
8
|
const isCliShortcutsEnabled = ()=>isTTY('stdin');
|
|
13
9
|
async function setupCliShortcuts({ closeServer, runAll, updateSnapshot, runFailedTests, runWithTestNamePattern, runWithFileFilters }) {
|
|
14
10
|
const { createInterface, emitKeypressEvents } = await import("node:readline");
|
|
@@ -66,28 +62,28 @@ async function setupCliShortcuts({ closeServer, runAll, updateSnapshot, runFaile
|
|
|
66
62
|
const shortcuts = [
|
|
67
63
|
{
|
|
68
64
|
key: 'f',
|
|
69
|
-
description: `${
|
|
65
|
+
description: `${color.bold('f')} ${color.dim('rerun failed tests')}`,
|
|
70
66
|
action: async ()=>{
|
|
71
67
|
await runFailedTests();
|
|
72
68
|
}
|
|
73
69
|
},
|
|
74
70
|
{
|
|
75
71
|
key: 'a',
|
|
76
|
-
description: `${
|
|
72
|
+
description: `${color.bold('a')} ${color.dim('rerun all tests')}`,
|
|
77
73
|
action: async ()=>{
|
|
78
74
|
await runAll();
|
|
79
75
|
}
|
|
80
76
|
},
|
|
81
77
|
{
|
|
82
78
|
key: 'u',
|
|
83
|
-
description: `${
|
|
79
|
+
description: `${color.bold('u')} ${color.dim('update snapshot')}`,
|
|
84
80
|
action: async ()=>{
|
|
85
81
|
await updateSnapshot();
|
|
86
82
|
}
|
|
87
83
|
},
|
|
88
84
|
{
|
|
89
85
|
key: 't',
|
|
90
|
-
description: `${
|
|
86
|
+
description: `${color.bold('t')} ${color.dim('filter by a test name regex pattern')}`,
|
|
91
87
|
action: async ()=>{
|
|
92
88
|
clearCurrentInputLine();
|
|
93
89
|
await promptInput('Enter test name pattern (empty to clear): ', async (pattern)=>{
|
|
@@ -97,7 +93,7 @@ async function setupCliShortcuts({ closeServer, runAll, updateSnapshot, runFaile
|
|
|
97
93
|
},
|
|
98
94
|
{
|
|
99
95
|
key: 'p',
|
|
100
|
-
description: `${
|
|
96
|
+
description: `${color.bold('p')} ${color.dim('filter by a filename regex pattern')}`,
|
|
101
97
|
action: async ()=>{
|
|
102
98
|
clearCurrentInputLine();
|
|
103
99
|
await promptInput('Enter file name pattern (empty to clear): ', async (input)=>{
|
|
@@ -108,14 +104,14 @@ async function setupCliShortcuts({ closeServer, runAll, updateSnapshot, runFaile
|
|
|
108
104
|
},
|
|
109
105
|
{
|
|
110
106
|
key: 'c',
|
|
111
|
-
description: `${
|
|
107
|
+
description: `${color.bold('c')} ${color.dim('clear screen')}`,
|
|
112
108
|
action: ()=>{
|
|
113
109
|
clearScreen(true);
|
|
114
110
|
}
|
|
115
111
|
},
|
|
116
112
|
{
|
|
117
113
|
key: 'q',
|
|
118
|
-
description: `${
|
|
114
|
+
description: `${color.bold('q')} ${color.dim('quit process')}`,
|
|
119
115
|
action: async ()=>{
|
|
120
116
|
try {
|
|
121
117
|
await closeServer();
|
|
@@ -135,7 +131,7 @@ async function setupCliShortcuts({ closeServer, runAll, updateSnapshot, runFaile
|
|
|
135
131
|
}
|
|
136
132
|
if ('h' === str) {
|
|
137
133
|
clearCurrentInputLine();
|
|
138
|
-
let message = ` ${
|
|
134
|
+
let message = ` ${color.bold(color.blue('Shortcuts:'))}\n`;
|
|
139
135
|
for (const shortcut of shortcuts)message += ` ${shortcut.description}\n`;
|
|
140
136
|
logger_logger.log(message);
|
|
141
137
|
}
|
|
@@ -234,7 +230,7 @@ async function runTests(context) {
|
|
|
234
230
|
recommendWorkerCount
|
|
235
231
|
});
|
|
236
232
|
const coverageProvider = coverage.enabled ? await createCoverageProvider(coverage, context.rootPath) : null;
|
|
237
|
-
if (coverageProvider) logger_logger.log(` ${
|
|
233
|
+
if (coverageProvider) logger_logger.log(` ${color.gray('Coverage enabled with')} %s\n`, color.yellow(coverage.provider));
|
|
238
234
|
const run = async ({ fileFilters, mode = 'all', buildStart = Date.now() } = {})=>{
|
|
239
235
|
for (const reporter of reporters)await reporter.onTestRunStart?.();
|
|
240
236
|
let testStart;
|
|
@@ -271,10 +267,10 @@ async function runTests(context) {
|
|
|
271
267
|
currentDeletedEntries.push(...deletedEntries);
|
|
272
268
|
let finalEntries = entries;
|
|
273
269
|
if ('on-demand' === mode) {
|
|
274
|
-
if (0 === affectedEntries.length) logger_logger.debug(
|
|
275
|
-
else logger_logger.debug(
|
|
270
|
+
if (0 === affectedEntries.length) logger_logger.debug(color.yellow(`No test files need re-run in project(${p.environmentName}).`));
|
|
271
|
+
else logger_logger.debug(color.yellow(`Test files to re-run in project(${p.environmentName}):\n`) + affectedEntries.map((e)=>e.testPath).join('\n') + '\n');
|
|
276
272
|
finalEntries = affectedEntries;
|
|
277
|
-
} else logger_logger.debug(
|
|
273
|
+
} else logger_logger.debug(color.yellow(fileFilters?.length ? `Run filtered tests in project(${p.environmentName}).\n` : `Run all tests in project(${p.environmentName}).\n`));
|
|
278
274
|
currentEntries.push(...finalEntries);
|
|
279
275
|
const { results, testResults } = await pool.runTests({
|
|
280
276
|
entries: finalEntries,
|
|
@@ -310,23 +306,23 @@ async function runTests(context) {
|
|
|
310
306
|
const nodeHasFailure = results.some((r)=>'fail' === r.status) || errors.length;
|
|
311
307
|
const browserHasFailure = shouldUnifyReporter && browserResult?.hasFailure;
|
|
312
308
|
if (0 === results.length && !errors.length) {
|
|
313
|
-
if ('watch' === command) if ('on-demand' === mode) logger_logger.log(
|
|
314
|
-
else logger_logger.log(
|
|
309
|
+
if ('watch' === command) if ('on-demand' === mode) logger_logger.log(color.yellow('No test files need re-run.'));
|
|
310
|
+
else logger_logger.log(color.yellow('No test files found.'));
|
|
315
311
|
else {
|
|
316
312
|
const code = context.normalizedConfig.passWithNoTests ? 0 : 1;
|
|
317
|
-
logger_logger.log(
|
|
313
|
+
logger_logger.log(color[code ? 'red' : 'yellow'](`No test files found, exiting with code ${code}.`));
|
|
318
314
|
process.exitCode = code;
|
|
319
315
|
}
|
|
320
316
|
if ('all' === mode) {
|
|
321
|
-
if (context.fileFilters?.length) logger_logger.log(
|
|
317
|
+
if (context.fileFilters?.length) logger_logger.log(color.gray('filter: '), context.fileFilters.join(color.gray(', ')));
|
|
322
318
|
projects.forEach((p)=>{
|
|
323
319
|
if (projects.length > 1) {
|
|
324
320
|
logger_logger.log('');
|
|
325
|
-
logger_logger.log(
|
|
321
|
+
logger_logger.log(color.gray('project:'), p.name);
|
|
326
322
|
}
|
|
327
|
-
logger_logger.log(
|
|
328
|
-
logger_logger.log(
|
|
329
|
-
logger_logger.log(
|
|
323
|
+
logger_logger.log(color.gray('root:'), p.rootPath);
|
|
324
|
+
logger_logger.log(color.gray('include:'), p.normalizedConfig.include.join(color.gray(', ')));
|
|
325
|
+
logger_logger.log(color.gray('exclude:'), p.normalizedConfig.exclude.patterns.join(color.gray(', ')));
|
|
330
326
|
});
|
|
331
327
|
}
|
|
332
328
|
}
|
|
@@ -355,7 +351,7 @@ async function runTests(context) {
|
|
|
355
351
|
}
|
|
356
352
|
if (isFailure) {
|
|
357
353
|
const bail = context.normalizedConfig.bail;
|
|
358
|
-
if (bail && context.stateManager.getCountOfFailedTests() >= bail) logger_logger.log(
|
|
354
|
+
if (bail && context.stateManager.getCountOfFailedTests() >= bail) logger_logger.log(color.yellow(`Test run aborted due to reaching the bail limit of ${bail} failed test(s).`));
|
|
359
355
|
}
|
|
360
356
|
};
|
|
361
357
|
if ('watch' === command) {
|
|
@@ -369,20 +365,20 @@ async function runTests(context) {
|
|
|
369
365
|
await pool.close();
|
|
370
366
|
await closeServer();
|
|
371
367
|
} catch (error) {
|
|
372
|
-
logger_logger.log(
|
|
368
|
+
logger_logger.log(color.red(`Error during cleanup: ${error}`));
|
|
373
369
|
}
|
|
374
370
|
};
|
|
375
371
|
const handleSignal = async (signal)=>{
|
|
376
|
-
logger_logger.log(
|
|
372
|
+
logger_logger.log(color.yellow(`\nReceived ${signal}, cleaning up...`));
|
|
377
373
|
await cleanup();
|
|
378
374
|
process.exit('SIGINT' === signal ? 130 : 143);
|
|
379
375
|
};
|
|
380
376
|
process.on('SIGINT', handleSignal);
|
|
381
377
|
process.on('SIGTERM', handleSignal);
|
|
382
378
|
const afterTestsWatchRun = ()=>{
|
|
383
|
-
logger_logger.log(
|
|
384
|
-
if (enableCliShortcuts) if (snapshotManager.summary.unmatched) logger_logger.log(` ${
|
|
385
|
-
else logger_logger.log(` ${
|
|
379
|
+
logger_logger.log(color.green(' Waiting for file changes...'));
|
|
380
|
+
if (enableCliShortcuts) if (snapshotManager.summary.unmatched) logger_logger.log(` ${color.dim('press')} ${color.yellow(color.bold('u'))} ${color.dim('to update snapshot')}${color.dim(', press')} ${color.bold('h')} ${color.dim('to show help')}\n`);
|
|
381
|
+
else logger_logger.log(` ${color.dim('press')} ${color.bold('h')} ${color.dim('to show help')}${color.dim(', press')} ${color.bold('q')} ${color.dim('to quit')}\n`);
|
|
386
382
|
};
|
|
387
383
|
const { onBeforeRestart } = await import("./0~6588.js").then((mod)=>({
|
|
388
384
|
onBeforeRestart: mod.onBeforeRestart
|
|
@@ -423,20 +419,20 @@ async function runTests(context) {
|
|
|
423
419
|
runWithTestNamePattern: async (pattern)=>{
|
|
424
420
|
clearScreen();
|
|
425
421
|
context.normalizedConfig.testNamePattern = pattern;
|
|
426
|
-
if (pattern) logger_logger.log(`\n${
|
|
427
|
-
else logger_logger.log(`\n${
|
|
422
|
+
if (pattern) logger_logger.log(`\n${color.dim('Applied testNamePattern:')} ${color.bold(pattern)}\n`);
|
|
423
|
+
else logger_logger.log(`\n${color.dim('Cleared testNamePattern filter')}\n`);
|
|
428
424
|
snapshotManager.clear();
|
|
429
425
|
await run();
|
|
430
426
|
afterTestsWatchRun();
|
|
431
427
|
},
|
|
432
428
|
runWithFileFilters: async (filters)=>{
|
|
433
429
|
clearScreen();
|
|
434
|
-
if (filters && filters.length > 0) logger_logger.log(`\n${
|
|
435
|
-
else logger_logger.log(`\n${
|
|
430
|
+
if (filters && filters.length > 0) logger_logger.log(`\n${color.dim('Applied file filters:')} ${color.bold(filters.join(', '))}\n`);
|
|
431
|
+
else logger_logger.log(`\n${color.dim('Cleared file filters')}\n`);
|
|
436
432
|
snapshotManager.clear();
|
|
437
433
|
context.fileFilters = filters;
|
|
438
434
|
const entries = await Promise.all(projects.map(async (p)=>globTestSourceEntries(p.environmentName))).then((entries)=>entries.reduce((acc, entry)=>acc.concat(...Object.values(entry)), []));
|
|
439
|
-
if (!entries.length) return void logger_logger.log(filters ?
|
|
435
|
+
if (!entries.length) return void logger_logger.log(filters ? color.yellow(`\nNo matching test files to run with current file filters: ${filters.join(',')}\n`) : color.yellow('\nNo matching test files to run.\n'));
|
|
440
436
|
await run({
|
|
441
437
|
fileFilters: entries
|
|
442
438
|
});
|
|
@@ -444,7 +440,7 @@ async function runTests(context) {
|
|
|
444
440
|
},
|
|
445
441
|
runFailedTests: async ()=>{
|
|
446
442
|
const failedTests = context.reporterResults.results.filter((result)=>'fail' === result.status).map((r)=>r.testPath);
|
|
447
|
-
if (!failedTests.length) return void logger_logger.log(
|
|
443
|
+
if (!failedTests.length) return void logger_logger.log(color.yellow('\nNo failed tests were found that needed to be rerun.'));
|
|
448
444
|
clearScreen();
|
|
449
445
|
snapshotManager.clear();
|
|
450
446
|
await run({
|
|
@@ -454,7 +450,7 @@ async function runTests(context) {
|
|
|
454
450
|
afterTestsWatchRun();
|
|
455
451
|
},
|
|
456
452
|
updateSnapshot: async ()=>{
|
|
457
|
-
if (!snapshotManager.summary.unmatched) return void logger_logger.log(
|
|
453
|
+
if (!snapshotManager.summary.unmatched) return void logger_logger.log(color.yellow('\nNo snapshots were found that needed to be updated.'));
|
|
458
454
|
const failedTests = context.reporterResults.results.filter((result)=>result.snapshotResult?.unmatched).map((r)=>r.testPath);
|
|
459
455
|
clearScreen();
|
|
460
456
|
const originalUpdateSnapshot = snapshotManager.options.updateSnapshot;
|
|
@@ -482,21 +478,21 @@ async function runTests(context) {
|
|
|
482
478
|
await pool.close();
|
|
483
479
|
await closeServer();
|
|
484
480
|
} catch (error) {
|
|
485
|
-
logger_logger.log(
|
|
481
|
+
logger_logger.log(color.red(`Error during cleanup: ${error}`));
|
|
486
482
|
}
|
|
487
483
|
};
|
|
488
484
|
const unExpectedExit = (code)=>{
|
|
489
|
-
if (isTeardown) logger_logger.log(
|
|
485
|
+
if (isTeardown) logger_logger.log(color.yellow(`Rstest exited unexpectedly with code ${code}, this is likely caused by test environment teardown.`));
|
|
490
486
|
else {
|
|
491
|
-
logger_logger.log(
|
|
487
|
+
logger_logger.log(color.red(`Rstest exited unexpectedly with code ${code}, terminating test run.`));
|
|
492
488
|
runGlobalTeardown().catch((error)=>{
|
|
493
|
-
logger_logger.log(
|
|
489
|
+
logger_logger.log(color.red(`Error in global teardown: ${error}`));
|
|
494
490
|
});
|
|
495
491
|
process.exitCode = 1;
|
|
496
492
|
}
|
|
497
493
|
};
|
|
498
494
|
const handleSignal = async (signal)=>{
|
|
499
|
-
logger_logger.log(
|
|
495
|
+
logger_logger.log(color.yellow(`\nReceived ${signal}, cleaning up...`));
|
|
500
496
|
await cleanup();
|
|
501
497
|
process.exit('SIGINT' === signal ? 130 : 143);
|
|
502
498
|
};
|
package/dist/0~2255.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
3
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
4
|
-
import "./
|
|
4
|
+
import "./3160.js";
|
|
5
5
|
const external_node_fs_ = __webpack_require__("node:fs");
|
|
6
6
|
const pluginCoverageCore = (coverageOptions)=>({
|
|
7
7
|
name: 'rstest:coverage-core',
|
package/dist/0~3919.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
3
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
4
|
-
import "./
|
|
4
|
+
import "./3160.js";
|
|
5
5
|
__webpack_require__.add({
|
|
6
6
|
"../../node_modules/.pnpm/js-tokens@4.0.0/node_modules/js-tokens/index.js" (__unused_rspack_module, exports) {
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
package/dist/0~4403.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
3
|
import { isDynamicPattern, glob } from "./1157.js";
|
|
4
|
-
import { normalize } from "./
|
|
5
|
-
import { logger as logger_logger } from "./3278.js";
|
|
4
|
+
import { normalize, logger as logger_logger } from "./3160.js";
|
|
6
5
|
const getIncludedFiles = async (coverage, rootPath, fs)=>{
|
|
7
6
|
const ignoredPatterns = coverage.exclude?.filter((item)=>isDynamicPattern(item) || item.startsWith(rootPath) || item.startsWith('./'));
|
|
8
7
|
const allFiles = await glob(coverage.include, {
|
package/dist/0~5835.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
3
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
4
|
-
import "./
|
|
4
|
+
import { logger as logger_logger } from "./3160.js";
|
|
5
5
|
import { createRequire as external_node_module_createRequire } from "./4881.js";
|
|
6
6
|
import { pathToFileURL } from "./6198.js";
|
|
7
7
|
import { node_vm, asModule, shouldInterop, interopModule } from "./0~3346.js";
|
|
8
|
-
import { posix
|
|
8
|
+
import { posix } from "./7011.js";
|
|
9
9
|
const external_node_path_ = __webpack_require__("node:path");
|
|
10
10
|
let latestAssetFiles = {};
|
|
11
11
|
const updateLatestAssetFiles = (assetFiles)=>{
|
package/dist/0~6588.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
3
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
4
|
-
import { isTTY } from "./
|
|
4
|
+
import { logger as logger_logger, color, isTTY, ansiEnabled } from "./3160.js";
|
|
5
5
|
import { runRest } from "./9131.js";
|
|
6
6
|
import "./1157.js";
|
|
7
|
-
import { logger as logger_logger } from "./3278.js";
|
|
8
7
|
const GLOB_REGEX = /[*?{}[\]()!@+|]/;
|
|
9
8
|
const isGlob = (str)=>GLOB_REGEX.test(str);
|
|
10
9
|
async function createChokidar(pathOrGlobs, root, options) {
|
|
@@ -30,20 +29,18 @@ async function createChokidar(pathOrGlobs, root, options) {
|
|
|
30
29
|
return chokidar.watch(Array.from(watchFiles), options);
|
|
31
30
|
}
|
|
32
31
|
const external_node_path_ = __webpack_require__("node:path");
|
|
33
|
-
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
34
|
-
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
35
32
|
let cleaners = [];
|
|
36
33
|
const onBeforeRestart = (cleaner)=>{
|
|
37
34
|
cleaners.push(cleaner);
|
|
38
35
|
};
|
|
39
36
|
const clearConsole = ()=>{
|
|
40
|
-
if (isTTY() && !process.env.DEBUG) process.stdout.write('\x1B[H\x1B[2J');
|
|
37
|
+
if (isTTY() && !process.env.DEBUG && ansiEnabled) process.stdout.write('\x1B[H\x1B[2J');
|
|
41
38
|
};
|
|
42
39
|
const beforeRestart = async ({ filePath, root, clear = true })=>{
|
|
43
40
|
if (clear) clearConsole();
|
|
44
41
|
if (filePath) {
|
|
45
42
|
const filename = external_node_path_["default"].relative(root, filePath);
|
|
46
|
-
logger_logger.info(`restarting Rstest as ${
|
|
43
|
+
logger_logger.info(`restarting Rstest as ${color.yellow(filename)} changed\n`);
|
|
47
44
|
} else logger_logger.info('restarting Rstest...\n');
|
|
48
45
|
for (const cleaner of cleaners)await cleaner();
|
|
49
46
|
cleaners = [];
|
package/dist/0~6923.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
3
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
4
|
-
import "./
|
|
4
|
+
import { logger as logger_logger } from "./3160.js";
|
|
5
5
|
import { pathToFileURL } from "./6198.js";
|
|
6
6
|
import { node_vm, interopModule, shouldInterop } from "./0~3346.js";
|
|
7
|
-
import { posix
|
|
7
|
+
import { posix } from "./7011.js";
|
|
8
8
|
const external_node_path_ = __webpack_require__("node:path");
|
|
9
9
|
var loadEsModule_EsmMode = /*#__PURE__*/ function(EsmMode) {
|
|
10
10
|
EsmMode[EsmMode["Unknown"] = 0] = "Unknown";
|