@rstest/core 0.9.1 → 0.9.2
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/dist/{0~89.js → 0~8843.js} +20 -24
- package/dist/{0~1472.js → 0~browserLoader.js} +5 -5
- package/dist/{0~7882.js → 0~browser~1.js} +32 -33
- package/dist/{0~8426.js → 0~checkThresholds.js} +2 -2
- package/dist/{0~130.js → 0~console.js} +15 -16
- package/dist/{0~9744.js → 0~dist.js} +57 -57
- package/dist/{0~7583.js → 0~esm.js} +66 -68
- package/dist/{0~4403.js → 0~generate.js} +5 -6
- package/dist/{0~4809.js → 0~happyDom.js} +2 -2
- package/dist/{0~3346.js → 0~interop.js} +0 -1
- package/dist/{0~62.js → 0~jsdom.js} +2 -2
- package/dist/{0~262.js → 0~lib.js} +4 -1
- package/dist/{0~9634.js → 0~listTests.js} +14 -23
- package/dist/{0~6923.js → 0~loadEsModule.js} +7 -7
- package/dist/{0~5835.js → 0~loadModule.js} +11 -11
- package/dist/{0~6907.js → 0~magic-string.es.js} +2 -1
- package/dist/{0~2255.js → 0~plugin.js} +2 -4
- package/dist/{0~6588.js → 0~restart.js} +7 -11
- package/dist/{0~2173.js → 0~runTests.js} +11 -20
- package/dist/{487.js → 1255.js} +22 -15
- package/dist/{6151.js → 1949.js} +15 -15
- package/dist/{6973.js → 255.js} +7 -8
- package/dist/{9131.js → 3145.js} +75 -404
- package/dist/{1157.js → 4411.js} +35 -35
- package/dist/{4484.js → 5040.js} +1 -2
- package/dist/{3160.js → 6830.js} +389 -81
- package/dist/7011.js +1 -1
- package/dist/{1294.js → 7552.js} +28 -22
- package/dist/{5734.js → 7704.js} +6 -5
- package/dist/browser-runtime/{2~907.js → 2~magic-string.es.js} +18 -11
- package/dist/browser-runtime/{389.js → 723.js} +39 -44
- package/dist/browser-runtime/{389.js.LICENSE.txt → 723.js.LICENSE.txt} +0 -22
- package/dist/browser-runtime/index.js +1 -1
- package/dist/browser-runtime/rslib-runtime.js +11 -3
- package/dist/browser.js +9 -7
- package/dist/globalSetupWorker.js +4 -13
- package/dist/index.js +2 -2
- package/dist/rslib-runtime.js +5 -8
- package/dist/worker.js +19 -45
- package/package.json +6 -6
- package/dist/3160.js.LICENSE.txt +0 -21
- package/dist/4881.js +0 -2
- package/dist/6198.js +0 -2
- /package/dist/{0~7583.js.LICENSE.txt → 0~esm.js.LICENSE.txt} +0 -0
- /package/dist/{0~3062.js → 0~utils.js} +0 -0
- /package/dist/{6151.js.LICENSE.txt → 1949.js.LICENSE.txt} +0 -0
- /package/dist/{4597.js → 1983.js} +0 -0
- /package/dist/{1294.js.LICENSE.txt → 7552.js.LICENSE.txt} +0 -0
package/dist/{9131.js → 3145.js}
RENAMED
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import node_fs, { existsSync, readFileSync, statSync } from "node:fs";
|
|
4
|
+
import { loadConfig, mergeRsbuildConfig } from "@rsbuild/core";
|
|
5
|
+
import { stripVTControlCharacters } from "node:util";
|
|
6
|
+
import promises from "node:fs/promises";
|
|
7
|
+
import node_path, { dirname as external_node_path_dirname, resolve as external_node_path_resolve } from "node:path";
|
|
8
|
+
import { createRequire } from "node:module";
|
|
9
|
+
import node_process from "node:process";
|
|
10
|
+
import { basename, isTTY, dirname as pathe_M_eThtNZ_dirname, resolve as pathe_M_eThtNZ_resolve, relative, getAbsolutePath, join, bgColor, formatRootStr, determineAgent, logger as logger_logger, castArray, dist_m, prettyTime, isDebug, color, isAbsolute, getTaskNameWithPrefix, normalize, formatError } from "./6830.js";
|
|
11
|
+
import { isDynamicPattern, glob, DEFAULT_CONFIG_NAME, prettyTestPath, globalApis, TEMP_RSTEST_OUTPUT_DIR_GLOB, formatTestPath, filterProjects, DEFAULT_CONFIG_EXTENSIONS, TS_CONFIG_FILE } from "./4411.js";
|
|
6
12
|
import { posix } from "./7011.js";
|
|
7
13
|
import { parse as stack_trace_parser_esm_parse } from "./1672.js";
|
|
8
14
|
import { decode } from "./4397.js";
|
|
9
|
-
import
|
|
15
|
+
import "./5040.js";
|
|
16
|
+
var init_namespaceObject = {};
|
|
17
|
+
__webpack_require__.r(init_namespaceObject);
|
|
18
|
+
__webpack_require__.d(init_namespaceObject, {
|
|
19
|
+
initCli: ()=>init_initCli
|
|
20
|
+
});
|
|
21
|
+
var src_core_namespaceObject = {};
|
|
22
|
+
__webpack_require__.r(src_core_namespaceObject);
|
|
23
|
+
__webpack_require__.d(src_core_namespaceObject, {
|
|
24
|
+
createRstest: ()=>core_createRstest
|
|
25
|
+
});
|
|
26
|
+
var error_namespaceObject = {};
|
|
27
|
+
__webpack_require__.r(error_namespaceObject);
|
|
28
|
+
__webpack_require__.d(error_namespaceObject, {
|
|
29
|
+
C: ()=>formatStack,
|
|
30
|
+
parseErrorStacktrace: ()=>error_parseErrorStacktrace,
|
|
31
|
+
printError: ()=>error_printError
|
|
32
|
+
});
|
|
10
33
|
function toArr(any) {
|
|
11
34
|
return null == any ? [] : Array.isArray(any) ? any : [
|
|
12
35
|
any
|
|
@@ -564,7 +587,7 @@ function prepareCli() {
|
|
|
564
587
|
if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) logger_logger.log();
|
|
565
588
|
}
|
|
566
589
|
function showRstest() {
|
|
567
|
-
logger_logger.greet(" Rstest v0.9.
|
|
590
|
+
logger_logger.greet(" Rstest v0.9.2");
|
|
568
591
|
logger_logger.log('');
|
|
569
592
|
}
|
|
570
593
|
const applyCommonOptions = (cli)=>{
|
|
@@ -585,13 +608,9 @@ const runRest = async ({ options, filters, command })=>{
|
|
|
585
608
|
handleUnexpectedExit(rstest, err);
|
|
586
609
|
};
|
|
587
610
|
try {
|
|
588
|
-
const { initCli } = await Promise.resolve()
|
|
589
|
-
initCli: init_initCli
|
|
590
|
-
}));
|
|
611
|
+
const { initCli } = await Promise.resolve(init_namespaceObject);
|
|
591
612
|
const { config, configFilePath, projects } = await initCli(options);
|
|
592
|
-
const { createRstest } = await Promise.resolve()
|
|
593
|
-
createRstest: core_createRstest
|
|
594
|
-
}));
|
|
613
|
+
const { createRstest } = await Promise.resolve(src_core_namespaceObject);
|
|
595
614
|
rstest = createRstest({
|
|
596
615
|
config,
|
|
597
616
|
configFilePath,
|
|
@@ -600,10 +619,7 @@ const runRest = async ({ options, filters, command })=>{
|
|
|
600
619
|
process.on('uncaughtException', unexpectedlyExitHandler);
|
|
601
620
|
process.on('unhandledRejection', unexpectedlyExitHandler);
|
|
602
621
|
if ('watch' === command) {
|
|
603
|
-
const { watchFilesForRestart, onBeforeRestart } = await import("./0~
|
|
604
|
-
watchFilesForRestart: mod.watchFilesForRestart,
|
|
605
|
-
onBeforeRestart: mod.onBeforeRestart
|
|
606
|
-
}));
|
|
622
|
+
const { watchFilesForRestart, onBeforeRestart } = await import("./0~restart.js");
|
|
607
623
|
onBeforeRestart(()=>{
|
|
608
624
|
process.off('uncaughtException', unexpectedlyExitHandler);
|
|
609
625
|
process.off('unhandledRejection', unexpectedlyExitHandler);
|
|
@@ -622,7 +638,7 @@ const runRest = async ({ options, filters, command })=>{
|
|
|
622
638
|
function setupCommands() {
|
|
623
639
|
const cli = cac('rstest');
|
|
624
640
|
cli.help();
|
|
625
|
-
cli.version("0.9.
|
|
641
|
+
cli.version("0.9.2");
|
|
626
642
|
applyCommonOptions(cli);
|
|
627
643
|
cli.command('[...filters]', 'run tests').option('-w, --watch', 'Run tests in watch mode').action(async (filters, options)=>{
|
|
628
644
|
if (!determineAgent().isAgent) showRstest();
|
|
@@ -655,14 +671,10 @@ function setupCommands() {
|
|
|
655
671
|
});
|
|
656
672
|
cli.command('list [...filters]', 'lists all test files that Rstest will run').option('--filesOnly', 'only list the test files').option('--json [boolean/path]', 'print tests as JSON or write to a file').option('--includeSuites', 'include suites in output').option('--printLocation', 'print test case location').action(async (filters, options)=>{
|
|
657
673
|
try {
|
|
658
|
-
const { initCli } = await Promise.resolve()
|
|
659
|
-
initCli: init_initCli
|
|
660
|
-
}));
|
|
674
|
+
const { initCli } = await Promise.resolve(init_namespaceObject);
|
|
661
675
|
const { config, configFilePath, projects } = await initCli(options);
|
|
662
676
|
if (options.printLocation) config.includeTaskLocation = true;
|
|
663
|
-
const { createRstest } = await Promise.resolve()
|
|
664
|
-
createRstest: core_createRstest
|
|
665
|
-
}));
|
|
677
|
+
const { createRstest } = await Promise.resolve(src_core_namespaceObject);
|
|
666
678
|
const rstest = createRstest({
|
|
667
679
|
config,
|
|
668
680
|
configFilePath,
|
|
@@ -684,10 +696,7 @@ function setupCommands() {
|
|
|
684
696
|
try {
|
|
685
697
|
let selectedProject = project;
|
|
686
698
|
if (!selectedProject) {
|
|
687
|
-
const { select, isCancel } = await import("./0~
|
|
688
|
-
select: mod.Jt,
|
|
689
|
-
isCancel: mod.Ct
|
|
690
|
-
}));
|
|
699
|
+
const { select, isCancel } = await import("./0~dist.js");
|
|
691
700
|
console.log();
|
|
692
701
|
const selected = await select({
|
|
693
702
|
message: 'What would you like to initialize?',
|
|
@@ -706,9 +715,7 @@ function setupCommands() {
|
|
|
706
715
|
selectedProject = selected;
|
|
707
716
|
}
|
|
708
717
|
if ('browser' === selectedProject) {
|
|
709
|
-
const { create } = await import("./0~
|
|
710
|
-
create: mod.create
|
|
711
|
-
}));
|
|
718
|
+
const { create } = await import("./0~browser~1.js");
|
|
712
719
|
await create({
|
|
713
720
|
yes: options.yes
|
|
714
721
|
});
|
|
@@ -724,342 +731,18 @@ function setupCommands() {
|
|
|
724
731
|
});
|
|
725
732
|
cli.parse();
|
|
726
733
|
}
|
|
727
|
-
const
|
|
728
|
-
MODE: "production",
|
|
729
|
-
DEV: false,
|
|
730
|
-
PROD: true,
|
|
731
|
-
BASE_URL: "/",
|
|
732
|
-
ASSET_PREFIX: "auto"
|
|
733
|
-
}, dist_o = new Proxy(dist_r, {
|
|
734
|
-
get (e, s) {
|
|
735
|
-
return dist_i()[s] ?? dist_r[s];
|
|
736
|
-
},
|
|
737
|
-
has (e, s) {
|
|
738
|
-
const E = dist_i();
|
|
739
|
-
return s in E || s in dist_r;
|
|
740
|
-
},
|
|
741
|
-
set (e, s, E) {
|
|
742
|
-
const B = dist_i(!0);
|
|
743
|
-
return B[s] = E, !0;
|
|
744
|
-
},
|
|
745
|
-
deleteProperty (e, s) {
|
|
746
|
-
if (!s) return !1;
|
|
747
|
-
const E = dist_i(!0);
|
|
748
|
-
return delete E[s], !0;
|
|
749
|
-
},
|
|
750
|
-
ownKeys () {
|
|
751
|
-
const e = dist_i(!0);
|
|
752
|
-
return Object.keys(e);
|
|
753
|
-
}
|
|
754
|
-
}), dist_t = typeof process < "u" && process.env && process.env.NODE_ENV || "", f = [
|
|
755
|
-
[
|
|
756
|
-
"APPVEYOR"
|
|
757
|
-
],
|
|
758
|
-
[
|
|
759
|
-
"AWS_AMPLIFY",
|
|
760
|
-
"AWS_APP_ID",
|
|
761
|
-
{
|
|
762
|
-
ci: !0
|
|
763
|
-
}
|
|
764
|
-
],
|
|
765
|
-
[
|
|
766
|
-
"AZURE_PIPELINES",
|
|
767
|
-
"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"
|
|
768
|
-
],
|
|
769
|
-
[
|
|
770
|
-
"AZURE_STATIC",
|
|
771
|
-
"INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"
|
|
772
|
-
],
|
|
773
|
-
[
|
|
774
|
-
"APPCIRCLE",
|
|
775
|
-
"AC_APPCIRCLE"
|
|
776
|
-
],
|
|
777
|
-
[
|
|
778
|
-
"BAMBOO",
|
|
779
|
-
"bamboo_planKey"
|
|
780
|
-
],
|
|
781
|
-
[
|
|
782
|
-
"BITBUCKET",
|
|
783
|
-
"BITBUCKET_COMMIT"
|
|
784
|
-
],
|
|
785
|
-
[
|
|
786
|
-
"BITRISE",
|
|
787
|
-
"BITRISE_IO"
|
|
788
|
-
],
|
|
789
|
-
[
|
|
790
|
-
"BUDDY",
|
|
791
|
-
"BUDDY_WORKSPACE_ID"
|
|
792
|
-
],
|
|
793
|
-
[
|
|
794
|
-
"BUILDKITE"
|
|
795
|
-
],
|
|
796
|
-
[
|
|
797
|
-
"CIRCLE",
|
|
798
|
-
"CIRCLECI"
|
|
799
|
-
],
|
|
800
|
-
[
|
|
801
|
-
"CIRRUS",
|
|
802
|
-
"CIRRUS_CI"
|
|
803
|
-
],
|
|
804
|
-
[
|
|
805
|
-
"CLOUDFLARE_PAGES",
|
|
806
|
-
"CF_PAGES",
|
|
807
|
-
{
|
|
808
|
-
ci: !0
|
|
809
|
-
}
|
|
810
|
-
],
|
|
811
|
-
[
|
|
812
|
-
"CLOUDFLARE_WORKERS",
|
|
813
|
-
"WORKERS_CI",
|
|
814
|
-
{
|
|
815
|
-
ci: !0
|
|
816
|
-
}
|
|
817
|
-
],
|
|
818
|
-
[
|
|
819
|
-
"CODEBUILD",
|
|
820
|
-
"CODEBUILD_BUILD_ARN"
|
|
821
|
-
],
|
|
822
|
-
[
|
|
823
|
-
"CODEFRESH",
|
|
824
|
-
"CF_BUILD_ID"
|
|
825
|
-
],
|
|
826
|
-
[
|
|
827
|
-
"DRONE"
|
|
828
|
-
],
|
|
829
|
-
[
|
|
830
|
-
"DRONE",
|
|
831
|
-
"DRONE_BUILD_EVENT"
|
|
832
|
-
],
|
|
833
|
-
[
|
|
834
|
-
"DSARI"
|
|
835
|
-
],
|
|
836
|
-
[
|
|
837
|
-
"GITHUB_ACTIONS"
|
|
838
|
-
],
|
|
839
|
-
[
|
|
840
|
-
"GITLAB",
|
|
841
|
-
"GITLAB_CI"
|
|
842
|
-
],
|
|
843
|
-
[
|
|
844
|
-
"GITLAB",
|
|
845
|
-
"CI_MERGE_REQUEST_ID"
|
|
846
|
-
],
|
|
847
|
-
[
|
|
848
|
-
"GOCD",
|
|
849
|
-
"GO_PIPELINE_LABEL"
|
|
850
|
-
],
|
|
851
|
-
[
|
|
852
|
-
"LAYERCI"
|
|
853
|
-
],
|
|
854
|
-
[
|
|
855
|
-
"HUDSON",
|
|
856
|
-
"HUDSON_URL"
|
|
857
|
-
],
|
|
858
|
-
[
|
|
859
|
-
"JENKINS",
|
|
860
|
-
"JENKINS_URL"
|
|
861
|
-
],
|
|
862
|
-
[
|
|
863
|
-
"MAGNUM"
|
|
864
|
-
],
|
|
865
|
-
[
|
|
866
|
-
"NETLIFY"
|
|
867
|
-
],
|
|
868
|
-
[
|
|
869
|
-
"NETLIFY",
|
|
870
|
-
"NETLIFY_LOCAL",
|
|
871
|
-
{
|
|
872
|
-
ci: !1
|
|
873
|
-
}
|
|
874
|
-
],
|
|
875
|
-
[
|
|
876
|
-
"NEVERCODE"
|
|
877
|
-
],
|
|
878
|
-
[
|
|
879
|
-
"RENDER"
|
|
880
|
-
],
|
|
881
|
-
[
|
|
882
|
-
"SAIL",
|
|
883
|
-
"SAILCI"
|
|
884
|
-
],
|
|
885
|
-
[
|
|
886
|
-
"SEMAPHORE"
|
|
887
|
-
],
|
|
888
|
-
[
|
|
889
|
-
"SCREWDRIVER"
|
|
890
|
-
],
|
|
891
|
-
[
|
|
892
|
-
"SHIPPABLE"
|
|
893
|
-
],
|
|
894
|
-
[
|
|
895
|
-
"SOLANO",
|
|
896
|
-
"TDDIUM"
|
|
897
|
-
],
|
|
898
|
-
[
|
|
899
|
-
"STRIDER"
|
|
900
|
-
],
|
|
901
|
-
[
|
|
902
|
-
"TEAMCITY",
|
|
903
|
-
"TEAMCITY_VERSION"
|
|
904
|
-
],
|
|
905
|
-
[
|
|
906
|
-
"TRAVIS"
|
|
907
|
-
],
|
|
908
|
-
[
|
|
909
|
-
"VERCEL",
|
|
910
|
-
"NOW_BUILDER"
|
|
911
|
-
],
|
|
912
|
-
[
|
|
913
|
-
"VERCEL",
|
|
914
|
-
"VERCEL",
|
|
915
|
-
{
|
|
916
|
-
ci: !1
|
|
917
|
-
}
|
|
918
|
-
],
|
|
919
|
-
[
|
|
920
|
-
"VERCEL",
|
|
921
|
-
"VERCEL_ENV",
|
|
922
|
-
{
|
|
923
|
-
ci: !1
|
|
924
|
-
}
|
|
925
|
-
],
|
|
926
|
-
[
|
|
927
|
-
"APPCENTER",
|
|
928
|
-
"APPCENTER_BUILD_ID"
|
|
929
|
-
],
|
|
930
|
-
[
|
|
931
|
-
"CODESANDBOX",
|
|
932
|
-
"CODESANDBOX_SSE",
|
|
933
|
-
{
|
|
934
|
-
ci: !1
|
|
935
|
-
}
|
|
936
|
-
],
|
|
937
|
-
[
|
|
938
|
-
"CODESANDBOX",
|
|
939
|
-
"CODESANDBOX_HOST",
|
|
940
|
-
{
|
|
941
|
-
ci: !1
|
|
942
|
-
}
|
|
943
|
-
],
|
|
944
|
-
[
|
|
945
|
-
"STACKBLITZ"
|
|
946
|
-
],
|
|
947
|
-
[
|
|
948
|
-
"STORMKIT"
|
|
949
|
-
],
|
|
950
|
-
[
|
|
951
|
-
"CLEAVR"
|
|
952
|
-
],
|
|
953
|
-
[
|
|
954
|
-
"ZEABUR"
|
|
955
|
-
],
|
|
956
|
-
[
|
|
957
|
-
"CODESPHERE",
|
|
958
|
-
"CODESPHERE_APP_ID",
|
|
959
|
-
{
|
|
960
|
-
ci: !0
|
|
961
|
-
}
|
|
962
|
-
],
|
|
963
|
-
[
|
|
964
|
-
"RAILWAY",
|
|
965
|
-
"RAILWAY_PROJECT_ID"
|
|
966
|
-
],
|
|
967
|
-
[
|
|
968
|
-
"RAILWAY",
|
|
969
|
-
"RAILWAY_SERVICE_ID"
|
|
970
|
-
],
|
|
971
|
-
[
|
|
972
|
-
"DENO-DEPLOY",
|
|
973
|
-
"DENO_DEPLOYMENT_ID"
|
|
974
|
-
],
|
|
975
|
-
[
|
|
976
|
-
"FIREBASE_APP_HOSTING",
|
|
977
|
-
"FIREBASE_APP_HOSTING",
|
|
978
|
-
{
|
|
979
|
-
ci: !0
|
|
980
|
-
}
|
|
981
|
-
]
|
|
982
|
-
];
|
|
983
|
-
function dist_b() {
|
|
984
|
-
if (globalThis.process?.env) for (const e of f){
|
|
985
|
-
const s = e[1] || e[0];
|
|
986
|
-
if (globalThis.process?.env[s]) return {
|
|
987
|
-
name: e[0].toLowerCase(),
|
|
988
|
-
...e[2]
|
|
989
|
-
};
|
|
990
|
-
}
|
|
991
|
-
return globalThis.process?.env?.SHELL === "/bin/jsh" && globalThis.process?.versions?.webcontainer ? {
|
|
992
|
-
name: "stackblitz",
|
|
993
|
-
ci: !1
|
|
994
|
-
} : {
|
|
995
|
-
name: "",
|
|
996
|
-
ci: !1
|
|
997
|
-
};
|
|
998
|
-
}
|
|
999
|
-
const l = dist_b();
|
|
1000
|
-
l.name;
|
|
1001
|
-
function n(e) {
|
|
1002
|
-
return e ? "false" !== e : !1;
|
|
1003
|
-
}
|
|
1004
|
-
const I = globalThis.process?.platform || "", T = n(dist_o.CI) || !1 !== l.ci, R = n(globalThis.process?.stdout && globalThis.process?.stdout.isTTY), A = (n(dist_o.DEBUG), "test" === dist_t || n(dist_o.TEST), n(dist_o.MINIMAL), /^win/i.test(I)), C = (/^linux/i.test(I), /^darwin/i.test(I), !n(dist_o.NO_COLOR) && (n(dist_o.FORCE_COLOR) || (R || A) && dist_o.TERM), (globalThis.process?.versions?.node || "").replace(/^v/, "") || null), W = (Number(C?.split(".")[0]), globalThis.process || Object.create(null)), dist_ = {
|
|
1005
|
-
versions: {}
|
|
1006
|
-
}, O = (new Proxy(W, {
|
|
1007
|
-
get (e, s) {
|
|
1008
|
-
if ("env" === s) return dist_o;
|
|
1009
|
-
if (s in e) return e[s];
|
|
1010
|
-
if (s in dist_) return dist_[s];
|
|
1011
|
-
}
|
|
1012
|
-
}), globalThis.process?.release?.name === "node"), c = !!globalThis.Bun || !!globalThis.process?.versions?.bun, D = !!globalThis.Deno, L = !!globalThis.fastly, S = !!globalThis.Netlify, u = !!globalThis.EdgeRuntime, N = globalThis.navigator?.userAgent === "Cloudflare-Workers", F = [
|
|
1013
|
-
[
|
|
1014
|
-
S,
|
|
1015
|
-
"netlify"
|
|
1016
|
-
],
|
|
1017
|
-
[
|
|
1018
|
-
u,
|
|
1019
|
-
"edge-light"
|
|
1020
|
-
],
|
|
1021
|
-
[
|
|
1022
|
-
N,
|
|
1023
|
-
"workerd"
|
|
1024
|
-
],
|
|
1025
|
-
[
|
|
1026
|
-
L,
|
|
1027
|
-
"fastly"
|
|
1028
|
-
],
|
|
1029
|
-
[
|
|
1030
|
-
D,
|
|
1031
|
-
"deno"
|
|
1032
|
-
],
|
|
1033
|
-
[
|
|
1034
|
-
c,
|
|
1035
|
-
"bun"
|
|
1036
|
-
],
|
|
1037
|
-
[
|
|
1038
|
-
O,
|
|
1039
|
-
"node"
|
|
1040
|
-
]
|
|
1041
|
-
];
|
|
1042
|
-
function G() {
|
|
1043
|
-
const e = F.find((s)=>s[0]);
|
|
1044
|
-
if (e) return {
|
|
1045
|
-
name: e[1]
|
|
1046
|
-
};
|
|
1047
|
-
}
|
|
1048
|
-
const P = G();
|
|
1049
|
-
P?.name;
|
|
1050
|
-
const external_node_fs_ = __webpack_require__("node:fs");
|
|
1051
|
-
const findConfig = (basePath)=>DEFAULT_CONFIG_EXTENSIONS.map((ext)=>basePath + ext).find(external_node_fs_["default"].existsSync);
|
|
734
|
+
const findConfig = (basePath)=>DEFAULT_CONFIG_EXTENSIONS.map((ext)=>basePath + ext).find(node_fs.existsSync);
|
|
1052
735
|
const resolveConfigPath = (root, customConfig)=>{
|
|
1053
736
|
if (customConfig) {
|
|
1054
737
|
const customConfigPath = isAbsolute(customConfig) ? customConfig : join(root, customConfig);
|
|
1055
|
-
if (
|
|
738
|
+
if (node_fs.existsSync(customConfigPath)) return customConfigPath;
|
|
1056
739
|
throw `Cannot find config file: ${color.dim(customConfigPath)}`;
|
|
1057
740
|
}
|
|
1058
741
|
const configFilePath = findConfig(join(root, DEFAULT_CONFIG_NAME));
|
|
1059
742
|
if (configFilePath) return configFilePath;
|
|
1060
743
|
return null;
|
|
1061
744
|
};
|
|
1062
|
-
async function
|
|
745
|
+
async function config_loadConfig({ cwd = process.cwd(), path, envMode, configLoader }) {
|
|
1063
746
|
const configFilePath = resolveConfigPath(cwd, path);
|
|
1064
747
|
if (!configFilePath) {
|
|
1065
748
|
logger_logger.debug('no rstest config file found');
|
|
@@ -1068,7 +751,7 @@ async function loadConfig({ cwd = process.cwd(), path, envMode, configLoader })
|
|
|
1068
751
|
filePath: configFilePath
|
|
1069
752
|
};
|
|
1070
753
|
}
|
|
1071
|
-
const { content } = await
|
|
754
|
+
const { content } = await loadConfig({
|
|
1072
755
|
cwd: pathe_M_eThtNZ_dirname(configFilePath),
|
|
1073
756
|
path: configFilePath,
|
|
1074
757
|
envMode,
|
|
@@ -1089,7 +772,7 @@ async function loadConfig({ cwd = process.cwd(), path, envMode, configLoader })
|
|
|
1089
772
|
}
|
|
1090
773
|
const mergeProjectConfig = (...configs)=>mergeRstestConfig(...configs);
|
|
1091
774
|
const mergeRstestConfig = (...configs)=>configs.reduce((result, config)=>{
|
|
1092
|
-
const merged =
|
|
775
|
+
const merged = mergeRsbuildConfig(result, {
|
|
1093
776
|
...config,
|
|
1094
777
|
exclude: Array.isArray(config.exclude) ? {
|
|
1095
778
|
patterns: config.exclude,
|
|
@@ -1164,7 +847,7 @@ const createDefaultConfig = ()=>({
|
|
|
1164
847
|
enabled: false,
|
|
1165
848
|
provider: 'playwright',
|
|
1166
849
|
browser: 'chromium',
|
|
1167
|
-
headless:
|
|
850
|
+
headless: dist_m,
|
|
1168
851
|
strictPort: false
|
|
1169
852
|
},
|
|
1170
853
|
coverage: {
|
|
@@ -1209,7 +892,7 @@ const withDefaultConfig = (config)=>{
|
|
|
1209
892
|
enabled: merged.browser?.enabled ?? false,
|
|
1210
893
|
provider: merged.browser?.provider ?? 'playwright',
|
|
1211
894
|
browser: merged.browser?.browser ?? 'chromium',
|
|
1212
|
-
headless: merged.browser?.headless ??
|
|
895
|
+
headless: merged.browser?.headless ?? dist_m,
|
|
1213
896
|
port: merged.browser?.port,
|
|
1214
897
|
strictPort: merged.browser?.strictPort ?? false,
|
|
1215
898
|
viewport: merged.browser?.viewport
|
|
@@ -1307,7 +990,7 @@ function mergeWithCLIOptions(config, options) {
|
|
|
1307
990
|
return config;
|
|
1308
991
|
}
|
|
1309
992
|
async function resolveConfig(options) {
|
|
1310
|
-
const { content: config, filePath: configFilePath } = await
|
|
993
|
+
const { content: config, filePath: configFilePath } = await config_loadConfig({
|
|
1311
994
|
cwd: options.cwd,
|
|
1312
995
|
path: options.config,
|
|
1313
996
|
configLoader: options.configLoader
|
|
@@ -1323,7 +1006,7 @@ async function resolveProjects({ config, root, options }) {
|
|
|
1323
1006
|
if (!config.projects) return [];
|
|
1324
1007
|
const getDefaultProjectName = (dir)=>{
|
|
1325
1008
|
const pkgJsonPath = pathe_M_eThtNZ_resolve(dir, 'package.json');
|
|
1326
|
-
const name =
|
|
1009
|
+
const name = existsSync(pkgJsonPath) ? JSON.parse(readFileSync(pkgJsonPath, 'utf-8')).name : '';
|
|
1327
1010
|
if ('string' != typeof name || !name) return basename(dir);
|
|
1328
1011
|
return name;
|
|
1329
1012
|
};
|
|
@@ -1373,14 +1056,14 @@ async function resolveProjects({ config, root, options }) {
|
|
|
1373
1056
|
if (isDynamicPattern(projectStr)) projectPatterns.push(projectStr);
|
|
1374
1057
|
else {
|
|
1375
1058
|
const absolutePath = getAbsolutePath(root, projectStr);
|
|
1376
|
-
if (!
|
|
1059
|
+
if (!existsSync(absolutePath)) throw `Can't resolve project "${p}", please make sure "${p}" is a existing file or a directory.`;
|
|
1377
1060
|
projectPaths.push(absolutePath);
|
|
1378
1061
|
}
|
|
1379
1062
|
}));
|
|
1380
1063
|
projectPaths.push(...await globProjects(projectPatterns, root));
|
|
1381
1064
|
const projects = [];
|
|
1382
1065
|
await Promise.all(projectPaths.map(async (project)=>{
|
|
1383
|
-
const isDirectory =
|
|
1066
|
+
const isDirectory = statSync(project).isDirectory();
|
|
1384
1067
|
const projectRoot = isDirectory ? project : pathe_M_eThtNZ_dirname(project);
|
|
1385
1068
|
const { config, configFilePath } = await resolveConfig({
|
|
1386
1069
|
...options,
|
|
@@ -1570,9 +1253,7 @@ const printSummaryErrorLogs = async ({ testResults, results, rootPath, unhandled
|
|
|
1570
1253
|
logger_logger.stderr('');
|
|
1571
1254
|
logger_logger.stderr(color.bold('Summary of all failing tests:'));
|
|
1572
1255
|
logger_logger.stderr('');
|
|
1573
|
-
const { printError } = await Promise.resolve()
|
|
1574
|
-
printError: error_printError
|
|
1575
|
-
}));
|
|
1256
|
+
const { printError } = await Promise.resolve(error_namespaceObject);
|
|
1576
1257
|
for (const error of unhandledErrors || []){
|
|
1577
1258
|
logger_logger.stderr(bgColor('bgRed', ' Unhandled Error '));
|
|
1578
1259
|
await printError(error, getSourcemap, rootPath);
|
|
@@ -1582,14 +1263,11 @@ const printSummaryErrorLogs = async ({ testResults, results, rootPath, unhandled
|
|
|
1582
1263
|
const nameStr = getTaskNameWithPrefix(test);
|
|
1583
1264
|
logger_logger.stderr(`${bgColor('bgRed', ' FAIL ')} ${prettyTestPath(relativePath)} ${nameStr.length ? `${color.dim(">")} ${nameStr}` : ''}`);
|
|
1584
1265
|
if (test.errors) {
|
|
1585
|
-
const { printError } = await Promise.resolve()
|
|
1586
|
-
printError: error_printError
|
|
1587
|
-
}));
|
|
1266
|
+
const { printError } = await Promise.resolve(error_namespaceObject);
|
|
1588
1267
|
for (const error of test.errors)await printError(error, getSourcemap, rootPath);
|
|
1589
1268
|
}
|
|
1590
1269
|
}
|
|
1591
1270
|
};
|
|
1592
|
-
const external_node_util_ = __webpack_require__("node:util");
|
|
1593
1271
|
const DEFAULT_RENDER_INTERVAL_MS = 1000;
|
|
1594
1272
|
const ESC = '\x1B[';
|
|
1595
1273
|
const CLEAR_LINE = `${ESC}K`;
|
|
@@ -1707,7 +1385,7 @@ class WindowRenderer {
|
|
|
1707
1385
|
function getRenderedRowCount(rows, columns) {
|
|
1708
1386
|
let count = 0;
|
|
1709
1387
|
for (const row of rows){
|
|
1710
|
-
const text =
|
|
1388
|
+
const text = stripVTControlCharacters(row);
|
|
1711
1389
|
count += Math.max(1, Math.ceil(text.length / columns));
|
|
1712
1390
|
}
|
|
1713
1391
|
return count;
|
|
@@ -1903,9 +1581,7 @@ class GithubActionsReporter {
|
|
|
1903
1581
|
...testResults.filter((i)=>'fail' === i.status)
|
|
1904
1582
|
];
|
|
1905
1583
|
if (0 === failedTests.length) return;
|
|
1906
|
-
const { parseErrorStacktrace } = await Promise.resolve()
|
|
1907
|
-
parseErrorStacktrace: error_parseErrorStacktrace
|
|
1908
|
-
}));
|
|
1584
|
+
const { parseErrorStacktrace } = await Promise.resolve(error_namespaceObject);
|
|
1909
1585
|
const logs = [];
|
|
1910
1586
|
for (const test of failedTests){
|
|
1911
1587
|
const { testPath } = test;
|
|
@@ -2255,7 +1931,6 @@ function traceSegmentInternal(segments, memo, line, column, bias) {
|
|
|
2255
1931
|
if (-1 === index || index === segments.length) return -1;
|
|
2256
1932
|
return index;
|
|
2257
1933
|
}
|
|
2258
|
-
const external_node_path_ = __webpack_require__("path");
|
|
2259
1934
|
const isRelativePath = (p)=>/^\.\.?\//.test(p);
|
|
2260
1935
|
const isHttpLikeFile = (file)=>/^https?:\/\//.test(file);
|
|
2261
1936
|
const hintNotDefinedError = (message)=>{
|
|
@@ -2302,9 +1977,9 @@ async function error_printError(error, getSourcemap, rootPath) {
|
|
|
2302
1977
|
async function printCodeFrame(frame) {
|
|
2303
1978
|
const filePath = frame.file?.startsWith('file') ? new URL(frame.file) : frame.file;
|
|
2304
1979
|
if (!filePath) return;
|
|
2305
|
-
const source =
|
|
1980
|
+
const source = node_fs.existsSync(filePath) ? node_fs.readFileSync(filePath, 'utf-8') : void 0;
|
|
2306
1981
|
if (!source) return;
|
|
2307
|
-
const { codeFrameColumns } = await import("./0~
|
|
1982
|
+
const { codeFrameColumns } = await import("./0~lib.js").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/@babel+code-frame@7.29.0/node_modules/@babel/code-frame/lib/index.js"));
|
|
2308
1983
|
const result = codeFrameColumns(source, {
|
|
2309
1984
|
start: {
|
|
2310
1985
|
line: frame.lineNumber,
|
|
@@ -2349,7 +2024,7 @@ async function error_parseErrorStacktrace({ stack, getSourcemap, fullStack = isD
|
|
|
2349
2024
|
if (!source) return null;
|
|
2350
2025
|
return {
|
|
2351
2026
|
...frame,
|
|
2352
|
-
file: isRelativePath(source) ? (
|
|
2027
|
+
file: isRelativePath(source) ? external_node_path_resolve(frame.file, '../', source) : (()=>{
|
|
2353
2028
|
try {
|
|
2354
2029
|
return new URL(source).pathname;
|
|
2355
2030
|
} catch {
|
|
@@ -2490,7 +2165,7 @@ class JUnitReporter {
|
|
|
2490
2165
|
};
|
|
2491
2166
|
const xmlContent = this.generateJUnitXml(report);
|
|
2492
2167
|
if (this.outputPath) try {
|
|
2493
|
-
const dirname =
|
|
2168
|
+
const dirname = node_path.dirname(this.outputPath);
|
|
2494
2169
|
await this.tryMkdir(dirname);
|
|
2495
2170
|
await promises.writeFile(this.outputPath, xmlContent, 'utf-8');
|
|
2496
2171
|
logger_logger.log(`JUnit XML report written to: ${this.outputPath}`);
|
|
@@ -2959,11 +2634,11 @@ async function pathExists(path2, type) {
|
|
|
2959
2634
|
}
|
|
2960
2635
|
}
|
|
2961
2636
|
function* lookup(cwd = node_process.cwd()) {
|
|
2962
|
-
let directory =
|
|
2963
|
-
const { root } =
|
|
2637
|
+
let directory = node_path.resolve(cwd);
|
|
2638
|
+
const { root } = node_path.parse(directory);
|
|
2964
2639
|
while(directory && directory !== root){
|
|
2965
2640
|
yield directory;
|
|
2966
|
-
directory =
|
|
2641
|
+
directory = node_path.dirname(directory);
|
|
2967
2642
|
}
|
|
2968
2643
|
}
|
|
2969
2644
|
async function parsePackageJson(filepath, options) {
|
|
@@ -2978,15 +2653,15 @@ async function detect(options = {}) {
|
|
|
2978
2653
|
] } = options;
|
|
2979
2654
|
let stopDir;
|
|
2980
2655
|
if ("string" == typeof options.stopDir) {
|
|
2981
|
-
const resolved =
|
|
2656
|
+
const resolved = node_path.resolve(options.stopDir);
|
|
2982
2657
|
stopDir = (dir)=>dir === resolved;
|
|
2983
2658
|
} else stopDir = options.stopDir;
|
|
2984
2659
|
for (const directory of lookup(cwd)){
|
|
2985
2660
|
for (const strategy of strategies)switch(strategy){
|
|
2986
2661
|
case "lockfile":
|
|
2987
|
-
for (const lock of Object.keys(LOCKS))if (await pathExists(
|
|
2662
|
+
for (const lock of Object.keys(LOCKS))if (await pathExists(node_path.join(directory, lock), "file")) {
|
|
2988
2663
|
const name = LOCKS[lock];
|
|
2989
|
-
const result = await parsePackageJson(
|
|
2664
|
+
const result = await parsePackageJson(node_path.join(directory, "package.json"), options);
|
|
2990
2665
|
if (result) return result;
|
|
2991
2666
|
return {
|
|
2992
2667
|
name,
|
|
@@ -2997,14 +2672,14 @@ async function detect(options = {}) {
|
|
|
2997
2672
|
case "packageManager-field":
|
|
2998
2673
|
case "devEngines-field":
|
|
2999
2674
|
{
|
|
3000
|
-
const result = await parsePackageJson(
|
|
2675
|
+
const result = await parsePackageJson(node_path.join(directory, "package.json"), options);
|
|
3001
2676
|
if (result) return result;
|
|
3002
2677
|
break;
|
|
3003
2678
|
}
|
|
3004
2679
|
case "install-metadata":
|
|
3005
2680
|
for (const metadata of Object.keys(INSTALL_METADATA)){
|
|
3006
2681
|
const fileOrDir = metadata.endsWith("/") ? "dir" : "file";
|
|
3007
|
-
if (await pathExists(
|
|
2682
|
+
if (await pathExists(node_path.join(directory, metadata), fileOrDir)) {
|
|
3008
2683
|
const name = INSTALL_METADATA[metadata];
|
|
3009
2684
|
const agent = "yarn" === name ? isMetadataYarnClassic(metadata) ? "yarn" : "yarn@berry" : name;
|
|
3010
2685
|
return {
|
|
@@ -3399,11 +3074,11 @@ const resolveModuleRoot = (spec)=>{
|
|
|
3399
3074
|
if ('function' == typeof import.meta.resolve) {
|
|
3400
3075
|
const resolved = import.meta.resolve(`${spec}/package.json`);
|
|
3401
3076
|
const filePath = resolved.startsWith('file://') ? new URL(resolved).pathname : resolved;
|
|
3402
|
-
return (
|
|
3077
|
+
return external_node_path_dirname(filePath);
|
|
3403
3078
|
}
|
|
3404
3079
|
} catch {}
|
|
3405
3080
|
try {
|
|
3406
|
-
return (
|
|
3081
|
+
return external_node_path_dirname(md_require.resolve(`${spec}/package.json`));
|
|
3407
3082
|
} catch {
|
|
3408
3083
|
return null;
|
|
3409
3084
|
}
|
|
@@ -3443,7 +3118,7 @@ const md_parseErrorStacktrace = async ({ stack, getSourcemap, fullStack = false
|
|
|
3443
3118
|
column: frame.column || 1
|
|
3444
3119
|
});
|
|
3445
3120
|
if (!source) return null;
|
|
3446
|
-
const mappedFile = md_isRelativePath(source) ? (
|
|
3121
|
+
const mappedFile = md_isRelativePath(source) ? external_node_path_resolve(file || '', '../', source) : (()=>{
|
|
3447
3122
|
try {
|
|
3448
3123
|
return new URL(source).pathname;
|
|
3449
3124
|
} catch {
|
|
@@ -3463,8 +3138,8 @@ const md_parseErrorStacktrace = async ({ stack, getSourcemap, fullStack = false
|
|
|
3463
3138
|
return dropNodeFrames(trimLeadingNodeFrames(filteredFrames));
|
|
3464
3139
|
};
|
|
3465
3140
|
const createCodeFrame = (filePath, { linesAbove, linesBelow, line, column })=>{
|
|
3466
|
-
if (!filePath || !
|
|
3467
|
-
const source =
|
|
3141
|
+
if (!filePath || !node_fs.existsSync(filePath)) return null;
|
|
3142
|
+
const source = node_fs.readFileSync(filePath, 'utf-8');
|
|
3468
3143
|
const sourceLines = source.split(/\r?\n/);
|
|
3469
3144
|
const lineNumber = Math.max(1, line || 1);
|
|
3470
3145
|
const columnNumber = Math.max(1, column || 1);
|
|
@@ -3526,7 +3201,7 @@ class MdReporter {
|
|
|
3526
3201
|
}
|
|
3527
3202
|
renderFrontMatter(lines) {
|
|
3528
3203
|
const frontMatter = {
|
|
3529
|
-
tool: "@rstest/core@0.9.
|
|
3204
|
+
tool: "@rstest/core@0.9.2",
|
|
3530
3205
|
timestamp: new Date().toISOString()
|
|
3531
3206
|
};
|
|
3532
3207
|
if (this.options.header.env) frontMatter.runtime = {
|
|
@@ -3897,10 +3572,10 @@ class Rstest {
|
|
|
3897
3572
|
process.exit(1);
|
|
3898
3573
|
}
|
|
3899
3574
|
const snapshotManager = new SnapshotManager({
|
|
3900
|
-
updateSnapshot: rstestConfig.update ? 'all' :
|
|
3575
|
+
updateSnapshot: rstestConfig.update ? 'all' : dist_m ? 'none' : 'new'
|
|
3901
3576
|
});
|
|
3902
3577
|
this.snapshotManager = snapshotManager;
|
|
3903
|
-
this.version = "0.9.
|
|
3578
|
+
this.version = "0.9.2";
|
|
3904
3579
|
this.rootPath = rootPath;
|
|
3905
3580
|
this.originalConfig = userConfig;
|
|
3906
3581
|
this.normalizedConfig = rstestConfig;
|
|
@@ -3918,7 +3593,7 @@ class Rstest {
|
|
|
3918
3593
|
if (config.source.tsconfigPath) config.source.tsconfigPath = getAbsolutePath(config.root, config.source.tsconfigPath);
|
|
3919
3594
|
else {
|
|
3920
3595
|
const tsconfigPath = join(config.root, TS_CONFIG_FILE);
|
|
3921
|
-
if (
|
|
3596
|
+
if (existsSync(tsconfigPath)) config.source.tsconfigPath = tsconfigPath;
|
|
3922
3597
|
}
|
|
3923
3598
|
return {
|
|
3924
3599
|
configFilePath: project.configFilePath,
|
|
@@ -4011,15 +3686,11 @@ function core_createRstest({ config, projects, configFilePath }, command, fileFi
|
|
|
4011
3686
|
projects
|
|
4012
3687
|
}, config);
|
|
4013
3688
|
const runTests = async ()=>{
|
|
4014
|
-
const { runTests } = await import("./0~
|
|
4015
|
-
runTests: mod.runTests
|
|
4016
|
-
}));
|
|
3689
|
+
const { runTests } = await import("./0~runTests.js");
|
|
4017
3690
|
await runTests(context);
|
|
4018
3691
|
};
|
|
4019
3692
|
const listTests = async (options)=>{
|
|
4020
|
-
const { listTests } = await import("./0~
|
|
4021
|
-
listTests: mod.listTests
|
|
4022
|
-
}));
|
|
3693
|
+
const { listTests } = await import("./0~listTests.js");
|
|
4023
3694
|
return listTests(context, options);
|
|
4024
3695
|
};
|
|
4025
3696
|
return {
|
|
@@ -4034,4 +3705,4 @@ function defineConfig(config) {
|
|
|
4034
3705
|
function defineProject(config) {
|
|
4035
3706
|
return config;
|
|
4036
3707
|
}
|
|
4037
|
-
export { core_createRstest as createRstest, defineConfig, defineProject, detect, error_printError, init_initCli as initCli,
|
|
3708
|
+
export { config_loadConfig as loadConfig, core_createRstest as createRstest, defineConfig, defineProject, detect, error_parseErrorStacktrace as parseErrorStacktrace, error_printError as printError, formatStack, init_initCli as initCli, mergeProjectConfig, mergeRstestConfig, resolveCommand, runCLI, runRest };
|