vitest 1.3.1 → 1.5.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/dist/browser.d.ts +4 -1
- package/dist/browser.js +1 -1
- package/dist/chunks/{integrations-globals.THajbSRg.js → integrations-globals.2J_Aii2q.js} +4 -4
- package/dist/chunks/{runtime-console.Iloo9fIt.js → runtime-console.kbFEN7E-.js} +16 -8
- package/dist/chunks/{runtime-runBaseTests.9RbsHRbU.js → runtime-runBaseTests.3fVSWBsC.js} +12 -10
- package/dist/cli-wrapper.js +1 -1
- package/dist/cli.js +7 -7
- package/dist/config.cjs +1 -0
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -0
- package/dist/coverage.d.ts +1 -1
- package/dist/environments.d.ts +1 -1
- package/dist/execute.d.ts +1 -1
- package/dist/execute.js +2 -2
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -4
- package/dist/node.d.ts +2 -2
- package/dist/node.js +7 -7
- package/dist/{reporters-MmQN-57K.d.ts → reporters-LqC_WI4d.d.ts} +233 -173
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +4 -4
- package/dist/runners.d.ts +2 -1
- package/dist/runners.js +10 -5
- package/dist/{suite-UrZdHRff.d.ts → suite-ynYMzeLu.d.ts} +1 -1
- package/dist/suite.d.ts +2 -2
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +6 -0
- package/dist/vendor/{base.Z38YsPLm.js → base.BjeeYg4o.js} +2 -2
- package/dist/vendor/{base.N3JkKp7j.js → base.Xt0Omgh7.js} +9 -3
- package/dist/vendor/{cac.wWT9ELdg.js → cac.qnW6GNL2.js} +258 -129
- package/dist/vendor/{constants.K-Wf1PUy.js → constants.5J7I254_.js} +2 -1
- package/dist/vendor/{execute.27Kk4lQF.js → execute.2_yoIC01.js} +1 -1
- package/dist/vendor/{index.9hqYxJUw.js → index.-ITFwqG_.js} +1 -1
- package/dist/vendor/{index.JZMafwT-.js → index.12jbrDSD.js} +1 -1
- package/dist/vendor/{index.c1V_jzyZ.js → index.kSaPvGW6.js} +69 -26
- package/dist/vendor/inspector.IgLX3ur5.js +54 -0
- package/dist/vendor/{setup-common.snyQUvE3.js → setup-common.A1De6efh.js} +8 -1
- package/dist/vendor/utils.0uYuCbzo.js +49 -0
- package/dist/vendor/{vi.C5mroSoP.js → vi.Fxjax7rQ.js} +37 -21
- package/dist/vendor/{vm.o1IruPAo.js → vm.I_IsyNig.js} +3 -3
- package/dist/worker.js +4 -26
- package/dist/workers/forks.js +5 -5
- package/dist/workers/runVmTests.js +11 -5
- package/dist/workers/threads.js +4 -4
- package/dist/workers/vmForks.js +10 -10
- package/dist/workers/vmThreads.js +9 -9
- package/dist/workers.d.ts +6 -3
- package/dist/workers.js +10 -9
- package/package.json +12 -12
- package/dist/vendor/utils.GbToHGHI.js +0 -41
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const defaultPort = 51204;
|
|
2
2
|
const defaultBrowserPort = 63315;
|
|
3
|
+
const defaultInspectPort = 9229;
|
|
3
4
|
const EXIT_CODE_RESTART = 43;
|
|
4
5
|
const API_PATH = "/__vitest_api__";
|
|
5
6
|
const extraInlineDeps = [
|
|
@@ -61,4 +62,4 @@ const globalApis = [
|
|
|
61
62
|
"onTestFailed"
|
|
62
63
|
];
|
|
63
64
|
|
|
64
|
-
export { API_PATH as A, CONFIG_NAMES as C, EXIT_CODE_RESTART as E, defaultBrowserPort as a, configFiles as c, defaultPort as d, extraInlineDeps as e, globalApis as g, workspacesFiles as w };
|
|
65
|
+
export { API_PATH as A, CONFIG_NAMES as C, EXIT_CODE_RESTART as E, defaultBrowserPort as a, defaultInspectPort as b, configFiles as c, defaultPort as d, extraInlineDeps as e, globalApis as g, workspacesFiles as w };
|
|
@@ -7,7 +7,7 @@ import { processError } from '@vitest/utils/error';
|
|
|
7
7
|
import { distDir } from '../path.js';
|
|
8
8
|
import { existsSync, readdirSync } from 'node:fs';
|
|
9
9
|
import { highlight, getType } from '@vitest/utils';
|
|
10
|
-
import { g as getAllMockableProperties } from './base.
|
|
10
|
+
import { g as getAllMockableProperties } from './base.Xt0Omgh7.js';
|
|
11
11
|
|
|
12
12
|
const spyModulePath = resolve(distDir, "spy.js");
|
|
13
13
|
class RefTracker {
|
|
@@ -5,7 +5,7 @@ import { distDir } from '../path.js';
|
|
|
5
5
|
import { g as getWorkerState } from './global.CkGT_TMy.js';
|
|
6
6
|
import { r as rpc } from './rpc.joBhAkyK.js';
|
|
7
7
|
import { t as takeCoverageInsideWorker } from './coverage.E7sG1b3r.js';
|
|
8
|
-
import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.
|
|
8
|
+
import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.A1De6efh.js';
|
|
9
9
|
|
|
10
10
|
function setupChaiConfig(config) {
|
|
11
11
|
Object.assign(chai.config, config);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
2
2
|
import { b as bench } from './benchmark.eeqk2rd8.js';
|
|
3
3
|
import { i as isFirstRun, a as runOnce } from './run-once.Olz_Zkd8.js';
|
|
4
|
-
import { c as createExpect, a as globalExpect, v as vi, b as vitest } from './vi.
|
|
4
|
+
import { c as createExpect, a as globalExpect, v as vi, b as vitest } from './vi.Fxjax7rQ.js';
|
|
5
5
|
import { g as getWorkerState } from './global.CkGT_TMy.js';
|
|
6
6
|
import * as chai from 'chai';
|
|
7
7
|
import { assert, should } from 'chai';
|
|
@@ -4,10 +4,10 @@ import { a as isNode, r as relativePath } from './index.ir9i0ywP.js';
|
|
|
4
4
|
import { generateHash, calculateSuiteHash, someTasksAreOnly, interpretTaskModes, getTasks, getTests, hasFailed, getSuites } from '@vitest/runner/utils';
|
|
5
5
|
import c from 'picocolors';
|
|
6
6
|
import { getSafeTimers, notNullish, inspect, positionToOffset, lineSplitRE, highlight, shuffle } from '@vitest/utils';
|
|
7
|
-
import { performance } from 'node:perf_hooks';
|
|
8
|
-
import { UNKNOWN_TEST_ID } from '../chunks/runtime-console.Iloo9fIt.js';
|
|
9
|
-
import { a as slash, t as toArray, b as isPrimitive } from './base.N3JkKp7j.js';
|
|
10
7
|
import { g as getFullName, h as hasFailedSnapshot } from './tasks.IknbGB2n.js';
|
|
8
|
+
import { performance } from 'node:perf_hooks';
|
|
9
|
+
import { UNKNOWN_TEST_ID } from '../chunks/runtime-console.kbFEN7E-.js';
|
|
10
|
+
import { a as slash, t as toArray, b as isPrimitive } from './base.Xt0Omgh7.js';
|
|
11
11
|
import { isCI } from 'std-env';
|
|
12
12
|
import { TraceMap, generatedPositionFor, parseErrorStacktrace } from '@vitest/utils/source-map';
|
|
13
13
|
import nodeos__default, { hostname } from 'node:os';
|
|
@@ -221,11 +221,33 @@ function formatProjectName(name, suffix = " ") {
|
|
|
221
221
|
return colors[index % colors.length](`|${name}|`) + suffix;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
+
const REGEXP_WRAP_PREFIX = "$$vitest:";
|
|
225
|
+
function getOutputFile(config, reporter) {
|
|
226
|
+
if (!(config == null ? void 0 : config.outputFile))
|
|
227
|
+
return;
|
|
228
|
+
if (typeof config.outputFile === "string")
|
|
229
|
+
return config.outputFile;
|
|
230
|
+
return config.outputFile[reporter];
|
|
231
|
+
}
|
|
232
|
+
function wrapSerializableConfig(config) {
|
|
233
|
+
let testNamePattern = config.testNamePattern;
|
|
234
|
+
let defines = config.defines;
|
|
235
|
+
if (testNamePattern && typeof testNamePattern !== "string")
|
|
236
|
+
testNamePattern = `${REGEXP_WRAP_PREFIX}${testNamePattern.toString()}`;
|
|
237
|
+
if (defines)
|
|
238
|
+
defines = { keys: Object.keys(defines), original: defines };
|
|
239
|
+
return {
|
|
240
|
+
...config,
|
|
241
|
+
testNamePattern,
|
|
242
|
+
defines
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
|
|
224
246
|
const A=r=>r!==null&&typeof r=="object",a=(r,t)=>Object.assign(new Error(`[${r}]: ${t}`),{code:r}),_$1="ERR_INVALID_PACKAGE_CONFIG",E$1="ERR_INVALID_PACKAGE_TARGET",I$1="ERR_PACKAGE_PATH_NOT_EXPORTED",R$1=/^\d+$/,O=/^(\.{1,2}|node_modules)$/i,w=/\/|\\/;var h$1=(r=>(r.Export="exports",r.Import="imports",r))(h$1||{});const f=(r,t,e,o,c)=>{if(t==null)return [];if(typeof t=="string"){const[n,...i]=t.split(w);if(n===".."||i.some(l=>O.test(l)))throw a(E$1,`Invalid "${r}" target "${t}" defined in the package config`);return [c?t.replace(/\*/g,c):t]}if(Array.isArray(t))return t.flatMap(n=>f(r,n,e,o,c));if(A(t)){for(const n of Object.keys(t)){if(R$1.test(n))throw a(_$1,"Cannot contain numeric property keys");if(n==="default"||o.includes(n))return f(r,t[n],e,o,c)}return []}throw a(E$1,`Invalid "${r}" target "${t}"`)},s="*",m=(r,t)=>{const e=r.indexOf(s),o=t.indexOf(s);return e===o?t.length>r.length:o>e};function d(r,t){if(!t.includes(s)&&r.hasOwnProperty(t))return [t];let e,o;for(const c of Object.keys(r))if(c.includes(s)){const[n,i,l]=c.split(s);if(l===void 0&&t.startsWith(n)&&t.endsWith(i)){const g=t.slice(n.length,-i.length||void 0);g&&(!e||m(e,c))&&(e=c,o=g);}}return [e,o]}const p=r=>Object.keys(r).reduce((t,e)=>{const o=e===""||e[0]!==".";if(t===void 0||t===o)return o;throw a(_$1,'"exports" cannot contain some keys starting with "." and some not')},void 0),u=/^\w+:/,v=(r,t,e)=>{if(!r)throw new Error('"exports" is required');t=t===""?".":`./${t}`,(typeof r=="string"||Array.isArray(r)||A(r)&&p(r))&&(r={".":r});const[o,c]=d(r,t),n=f(h$1.Export,r[o],t,e,c);if(n.length===0)throw a(I$1,t==="."?'No "exports" main defined':`Package subpath '${t}' is not defined by "exports"`);for(const i of n)if(!i.startsWith("./")&&!u.test(i))throw a(E$1,`Invalid "exports" target "${i}" defined in the package config`);return n};
|
|
225
247
|
|
|
226
|
-
function B(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}const x=e=>{const o=require$$0[e];return
|
|
227
|
-
`;break;case 114:u+="\r";break;case 116:u+=" ";break;case 117:const O=L(4,!0);O>=0?u+=String.fromCharCode(O):c=4;break;default:c=5;}g=n;continue}if(f>=0&&f<=31)if(_(f)){u+=e.substring(g,n),c=2;break}else c=6;n++;}return u}function
|
|
228
|
-
`),m++,b=n,s=14;switch(u){case 123:return n++,s=1;case 125:return n++,s=2;case 91:return n++,s=3;case 93:return n++,s=4;case 58:return n++,s=6;case 44:return n++,s=5;case 34:return n++,t=k(),s=10;case 47:const g=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<i&&!_(e.charCodeAt(n));)n++;return t=e.substring(g,n),s=12}if(e.charCodeAt(n+1)===42){n+=2;const f=i-1;let $=!1;for(;n<f;){const O=e.charCodeAt(n);if(O===42&&e.charCodeAt(n+1)===47){n+=2,$=!0;break}n++,_(O)&&(O===13&&e.charCodeAt(n)===10&&n++,m++,b=n);}return $||(n++,c=1),t=e.substring(g,n),s=13}return t+=String.fromCharCode(u),n++,s=16;case 45:if(t+=String.fromCharCode(u),n++,n===i||!N(e.charCodeAt(n)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return t+=w(),s=11;default:for(;n<i&&U(u);)n++,u=e.charCodeAt(n);if(l!==n){switch(t=e.substring(l,n),t){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return t+=String.fromCharCode(u),n++,s=16}}function U(u){if(J(u)||_(u))return !1;switch(u){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return !1}return !0}function F(){let u;do u=A();while(u>=12&&u<=15);return u}return {setPosition:T,getPosition:()=>n,scan:o?F:A,getToken:()=>s,getTokenValue:()=>t,getTokenOffset:()=>l,getTokenLength:()=>n-l,getTokenStartLine:()=>r,getTokenStartCharacter:()=>l-v,getTokenError:()=>c}}function J(e){return e===32||e===9}function _(e){return e===10||e===13}function N(e){return e>=48&&e<=57}var q;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab";})(q||(q={}));var I;(function(e){e.DEFAULT={allowTrailingComma:!1};})(I||(I={}));function Te(e,o=[],i=I.DEFAULT){let n=null,t=[];const l=[];function s(r){Array.isArray(t)?t.push(r):n!==null&&(t[n]=r);}return we(e,{onObjectBegin:()=>{const r={};s(r),l.push(t),t=r,n=null;},onObjectProperty:r=>{n=r;},onObjectEnd:()=>{t=l.pop();},onArrayBegin:()=>{const r=[];s(r),l.push(t),t=r,n=null;},onArrayEnd:()=>{t=l.pop();},onLiteralValue:s,onError:(r,b,v)=>{o.push({error:r,offset:b,length:v});}},i),t[0]}function we(e,o,i=I.DEFAULT){const n=be(e,!1),t=[];function l(a){return a?()=>a(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function s(a){return a?()=>a(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>t.slice()):()=>!0}function m(a){return a?j=>a(j,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function r(a){return a?j=>a(j,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>t.slice()):()=>!0}const b=s(o.onObjectBegin),v=r(o.onObjectProperty),c=l(o.onObjectEnd),L=s(o.onArrayBegin),T=l(o.onArrayEnd),w=r(o.onLiteralValue),k=m(o.onSeparator),A=l(o.onComment),U=m(o.onError),F=i&&i.disallowComments,u=i&&i.allowTrailingComma;function g(){for(;;){const a=n.scan();switch(n.getTokenError()){case 4:f(14);break;case 5:f(15);break;case 3:f(13);break;case 1:F||f(11);break;case 2:f(12);break;case 6:f(16);break}switch(a){case 12:case 13:F?f(10):A();break;case 16:f(1);break;case 15:case 14:break;default:return a}}}function f(a,j=[],Y=[]){if(U(a),j.length+Y.length>0){let y=n.getToken();for(;y!==17;){if(j.indexOf(y)!==-1){g();break}else if(Y.indexOf(y)!==-1)break;y=g();}}}function $(a){const j=n.getTokenValue();return a?w(j):(v(j),t.push(j)),g(),!0}function O(){switch(n.getToken()){case 11:const a=n.getTokenValue();let j=Number(a);isNaN(j)&&(f(2),j=0),w(j);break;case 7:w(null);break;case 8:w(!0);break;case 9:w(!1);break;default:return !1}return g(),!0}function ce(){return n.getToken()!==10?(f(3,[],[2,5]),!1):($(!1),n.getToken()===6?(k(":"),g(),V()||f(4,[],[2,5])):f(5,[],[2,5]),t.pop(),!0)}function fe(){b(),g();let a=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(a||f(4,[],[]),k(","),g(),n.getToken()===2&&u)break}else a&&f(6,[],[]);ce()||f(4,[],[2,5]),a=!0;}return c(),n.getToken()!==2?f(7,[2],[]):g(),!0}function pe(){L(),g();let a=!0,j=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(j||f(4,[],[]),k(","),g(),n.getToken()===4&&u)break}else j&&f(6,[],[]);a?(t.push(0),a=!1):t[t.length-1]++,V()||f(4,[],[4,5]),j=!0;}return T(),a||t.pop(),n.getToken()!==4?f(8,[4],[]):g(),!0}function V(){switch(n.getToken()){case 3:return pe();case 1:return fe();case 10:return $(!0);default:return O()}}return g(),n.getToken()===17?i.allowEmptyContent?!0:(f(4,[],[]),!1):V()?(n.getToken()!==17&&f(9,[],[]),!0):(f(4,[],[]),!1)}var K;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter";})(K||(K={}));var C;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF";})(C||(C={}));const ve=Te;var ee;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter";})(ee||(ee={}));const ne=(e,o)=>ve(ke(o,e,"utf8")),M=Symbol("implicitBaseUrl"),Oe=()=>{const{findPnpApi:e}=ge;return e&&e(process.cwd())},R=(e,o,i,n)=>{const t=`resolveFromPackageJsonPath:${e}:${o}:${i}`;if(n!=null&&n.has(t))return n.get(t);const l=ne(e,n);if(!l)return;let s=o||"tsconfig.json";if(!i&&l.exports)try{const[m]=v(l.exports,o,["require","types"]);s=m;}catch{return !1}else !o&&l.tsconfig&&(s=l.tsconfig);return s=p$1.join(e,"..",s),n==null||n.set(t,s),s},G="package.json",z="tsconfig.json",je=(e,o,i)=>{let n=e;if(e===".."&&(n=p$1.join(n,z)),e[0]==="."&&(n=p$1.resolve(o,n)),p$1.isAbsolute(n)){if(E(i,n)){if(P(i,n).isFile())return n}else if(!n.endsWith(".json")){const T=`${n}.json`;if(E(i,T))return T}return}const[t,...l]=e.split("/"),s=t[0]==="@"?`${t}/${l.shift()}`:t,m=l.join("/"),r=Oe();if(r){const{resolveRequest:T}=r;try{if(s===e){const w=T(p$1.join(s,G),o);if(w){const k=R(w,m,!1,i);if(k&&E(i,k))return k}}else {let w;try{w=T(e,o,{extensions:[".json"]});}catch{w=T(p$1.join(e,z),o);}if(w)return w}}catch{}}const b=Z(o,p$1.join("node_modules",s),i);if(!b||!P(i,b).isDirectory())return;const v=p$1.join(b,G);if(E(i,v)){const T=R(v,m,!1,i);if(T===!1)return;if(T&&E(i,T)&&P(i,T).isFile())return T}const c=p$1.join(b,m),L=c.endsWith(".json");if(!L){const T=`${c}.json`;if(E(i,T))return T}if(E(i,c)){if(P(i,c).isDirectory()){const T=p$1.join(c,G);if(E(i,T)){const k=R(T,"",!0,i);if(k&&E(i,k))return k}const w=p$1.join(c,z);if(E(i,w))return w}else if(L)return c}},Ae=(e,o,i,n)=>{const t=je(e,o,n);if(!t)throw new Error(`File '${e}' not found.`);if(i.has(t))throw new Error(`Circularity detected while resolving configuration: ${t}`);i.add(t);const l=p$1.dirname(t),s=te(t,n,i);delete s.references;const{compilerOptions:m}=s;if(m){const r=["baseUrl","outDir"];for(const b of r){const v=m[b];v&&(m[b]=B(p$1.relative(o,p$1.join(l,v)))||"./");}}return s.files&&(s.files=s.files.map(r=>B(p$1.relative(o,p$1.join(l,r))))),s.include&&(s.include=s.include.map(r=>B(p$1.relative(o,p$1.join(l,r))))),s.exclude&&(s.exclude=s.exclude.map(r=>B(p$1.relative(o,p$1.join(l,r))))),s},te=(e,o,i=new Set)=>{let n;try{n=ae(o,e);}catch{throw new Error(`Cannot resolve tsconfig at path: ${e}`)}let t=ne(n,o)||{};if(typeof t!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const l=p$1.dirname(n);if(t.compilerOptions){const{compilerOptions:s}=t;s.paths&&!s.baseUrl&&(s[M]=l);}if(t.extends){const s=Array.isArray(t.extends)?t.extends:[t.extends];delete t.extends;for(const m of s.reverse()){const r=Ae(m,l,i,o),b={...r,...t,compilerOptions:{...r.compilerOptions,...t.compilerOptions}};r.watchOptions&&(b.watchOptions={...r.watchOptions,...t.watchOptions}),t=b;}}if(t.compilerOptions){const{compilerOptions:s}=t,m=["baseUrl","rootDir"];for(const b of m){const v=s[b];if(v){const c=p$1.resolve(l,v),L=W(p$1.relative(l,c));s[b]=L;}}const{outDir:r}=s;r&&(Array.isArray(t.exclude)||(t.exclude=[]),t.exclude.includes(r)||t.exclude.push(r),s.outDir=W(r));}else t.compilerOptions={};if(t.files&&(t.files=t.files.map(W)),t.include&&(t.include=t.include.map(B)),t.watchOptions){const{watchOptions:s}=t;s.excludeDirectories&&(s.excludeDirectories=s.excludeDirectories.map(m=>B(p$1.resolve(l,m))));}return t},ie=(e,o=new Map)=>te(e,o),$e=(e=process.cwd(),o="tsconfig.json",i=new Map)=>{const n=Z(B(e),o,i);if(!n)return null;const t=ie(n,i);return {path:n,config:t}};p$1.posix;process.platform==="win32";
|
|
248
|
+
function B(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}const x=e=>{const o=require$$0[e];return (i,...n)=>{const t=`${e}:${n.join(":")}`;let l=i==null?void 0:i.get(t);return l===void 0&&(l=Reflect.apply(o,require$$0,n),i==null||i.set(t,l)),l}},E=x("existsSync"),ae=x("realpathSync"),ke=x("readFileSync"),P=x("statSync"),Z=(e,o,i)=>{for(;;){const n=p$1.posix.join(e,o);if(E(i,n))return n;const t=p$1.dirname(e);if(t===e)return;e=t;}},h=/^\.{1,2}(\/.*)?$/,W=e=>{const o=B(e);return h.test(o)?o:`./${o}`};function be(e,o=!1){const i=e.length;let n=0,t="",l=0,s=16,m=0,r=0,b=0,v=0,c=0;function L(u,g){let f=0,$=0;for(;f<u||!g;){let O=e.charCodeAt(n);if(O>=48&&O<=57)$=$*16+O-48;else if(O>=65&&O<=70)$=$*16+O-65+10;else if(O>=97&&O<=102)$=$*16+O-97+10;else break;n++,f++;}return f<u&&($=-1),$}function T(u){n=u,t="",l=0,s=16,c=0;}function w(){let u=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&N(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&N(e.charCodeAt(n)))for(n++;n<e.length&&N(e.charCodeAt(n));)n++;else return c=3,e.substring(u,n);let g=n;if(n<e.length&&(e.charCodeAt(n)===69||e.charCodeAt(n)===101))if(n++,(n<e.length&&e.charCodeAt(n)===43||e.charCodeAt(n)===45)&&n++,n<e.length&&N(e.charCodeAt(n))){for(n++;n<e.length&&N(e.charCodeAt(n));)n++;g=n;}else c=3;return e.substring(u,g)}function k(){let u="",g=n;for(;;){if(n>=i){u+=e.substring(g,n),c=2;break}const f=e.charCodeAt(n);if(f===34){u+=e.substring(g,n),n++;break}if(f===92){if(u+=e.substring(g,n),n++,n>=i){c=2;break}switch(e.charCodeAt(n++)){case 34:u+='"';break;case 92:u+="\\";break;case 47:u+="/";break;case 98:u+="\b";break;case 102:u+="\f";break;case 110:u+=`
|
|
249
|
+
`;break;case 114:u+="\r";break;case 116:u+=" ";break;case 117:const O=L(4,!0);O>=0?u+=String.fromCharCode(O):c=4;break;default:c=5;}g=n;continue}if(f>=0&&f<=31)if(_(f)){u+=e.substring(g,n),c=2;break}else c=6;n++;}return u}function j(){if(t="",c=0,l=n,r=m,v=b,n>=i)return l=i,s=17;let u=e.charCodeAt(n);if(J(u)){do n++,t+=String.fromCharCode(u),u=e.charCodeAt(n);while(J(u));return s=15}if(_(u))return n++,t+=String.fromCharCode(u),u===13&&e.charCodeAt(n)===10&&(n++,t+=`
|
|
250
|
+
`),m++,b=n,s=14;switch(u){case 123:return n++,s=1;case 125:return n++,s=2;case 91:return n++,s=3;case 93:return n++,s=4;case 58:return n++,s=6;case 44:return n++,s=5;case 34:return n++,t=k(),s=10;case 47:const g=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<i&&!_(e.charCodeAt(n));)n++;return t=e.substring(g,n),s=12}if(e.charCodeAt(n+1)===42){n+=2;const f=i-1;let $=!1;for(;n<f;){const O=e.charCodeAt(n);if(O===42&&e.charCodeAt(n+1)===47){n+=2,$=!0;break}n++,_(O)&&(O===13&&e.charCodeAt(n)===10&&n++,m++,b=n);}return $||(n++,c=1),t=e.substring(g,n),s=13}return t+=String.fromCharCode(u),n++,s=16;case 45:if(t+=String.fromCharCode(u),n++,n===i||!N(e.charCodeAt(n)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return t+=w(),s=11;default:for(;n<i&&U(u);)n++,u=e.charCodeAt(n);if(l!==n){switch(t=e.substring(l,n),t){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return t+=String.fromCharCode(u),n++,s=16}}function U(u){if(J(u)||_(u))return !1;switch(u){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return !1}return !0}function F(){let u;do u=j();while(u>=12&&u<=15);return u}return {setPosition:T,getPosition:()=>n,scan:o?F:j,getToken:()=>s,getTokenValue:()=>t,getTokenOffset:()=>l,getTokenLength:()=>n-l,getTokenStartLine:()=>r,getTokenStartCharacter:()=>l-v,getTokenError:()=>c}}function J(e){return e===32||e===9}function _(e){return e===10||e===13}function N(e){return e>=48&&e<=57}var q;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab";})(q||(q={}));var I;(function(e){e.DEFAULT={allowTrailingComma:!1};})(I||(I={}));function Te(e,o=[],i=I.DEFAULT){let n=null,t=[];const l=[];function s(r){Array.isArray(t)?t.push(r):n!==null&&(t[n]=r);}return we(e,{onObjectBegin:()=>{const r={};s(r),l.push(t),t=r,n=null;},onObjectProperty:r=>{n=r;},onObjectEnd:()=>{t=l.pop();},onArrayBegin:()=>{const r=[];s(r),l.push(t),t=r,n=null;},onArrayEnd:()=>{t=l.pop();},onLiteralValue:s,onError:(r,b,v)=>{o.push({error:r,offset:b,length:v});}},i),t[0]}function we(e,o,i=I.DEFAULT){const n=be(e,!1),t=[];function l(a){return a?()=>a(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function s(a){return a?()=>a(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>t.slice()):()=>!0}function m(a){return a?A=>a(A,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function r(a){return a?A=>a(A,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>t.slice()):()=>!0}const b=s(o.onObjectBegin),v=r(o.onObjectProperty),c=l(o.onObjectEnd),L=s(o.onArrayBegin),T=l(o.onArrayEnd),w=r(o.onLiteralValue),k=m(o.onSeparator),j=l(o.onComment),U=m(o.onError),F=i&&i.disallowComments,u=i&&i.allowTrailingComma;function g(){for(;;){const a=n.scan();switch(n.getTokenError()){case 4:f(14);break;case 5:f(15);break;case 3:f(13);break;case 1:F||f(11);break;case 2:f(12);break;case 6:f(16);break}switch(a){case 12:case 13:F?f(10):j();break;case 16:f(1);break;case 15:case 14:break;default:return a}}}function f(a,A=[],Y=[]){if(U(a),A.length+Y.length>0){let y=n.getToken();for(;y!==17;){if(A.indexOf(y)!==-1){g();break}else if(Y.indexOf(y)!==-1)break;y=g();}}}function $(a){const A=n.getTokenValue();return a?w(A):(v(A),t.push(A)),g(),!0}function O(){switch(n.getToken()){case 11:const a=n.getTokenValue();let A=Number(a);isNaN(A)&&(f(2),A=0),w(A);break;case 7:w(null);break;case 8:w(!0);break;case 9:w(!1);break;default:return !1}return g(),!0}function ce(){return n.getToken()!==10?(f(3,[],[2,5]),!1):($(!1),n.getToken()===6?(k(":"),g(),V()||f(4,[],[2,5])):f(5,[],[2,5]),t.pop(),!0)}function fe(){b(),g();let a=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(a||f(4,[],[]),k(","),g(),n.getToken()===2&&u)break}else a&&f(6,[],[]);ce()||f(4,[],[2,5]),a=!0;}return c(),n.getToken()!==2?f(7,[2],[]):g(),!0}function pe(){L(),g();let a=!0,A=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(A||f(4,[],[]),k(","),g(),n.getToken()===4&&u)break}else A&&f(6,[],[]);a?(t.push(0),a=!1):t[t.length-1]++,V()||f(4,[],[4,5]),A=!0;}return T(),a||t.pop(),n.getToken()!==4?f(8,[4],[]):g(),!0}function V(){switch(n.getToken()){case 3:return pe();case 1:return fe();case 10:return $(!0);default:return O()}}return g(),n.getToken()===17?i.allowEmptyContent?!0:(f(4,[],[]),!1):V()?(n.getToken()!==17&&f(9,[],[]),!0):(f(4,[],[]),!1)}var K;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter";})(K||(K={}));var C;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF";})(C||(C={}));const ve=Te;var ee;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter";})(ee||(ee={}));const ne=(e,o)=>ve(ke(o,e,"utf8")),M=Symbol("implicitBaseUrl"),Oe=()=>{const{findPnpApi:e}=ge;return e&&e(process.cwd())},R=(e,o,i,n)=>{const t=`resolveFromPackageJsonPath:${e}:${o}:${i}`;if(n!=null&&n.has(t))return n.get(t);const l=ne(e,n);if(!l)return;let s=o||"tsconfig.json";if(!i&&l.exports)try{const[m]=v(l.exports,o,["require","types"]);s=m;}catch{return !1}else !o&&l.tsconfig&&(s=l.tsconfig);return s=p$1.join(e,"..",s),n==null||n.set(t,s),s},G="package.json",z="tsconfig.json",Ae=(e,o,i)=>{let n=e;if(e===".."&&(n=p$1.join(n,z)),e[0]==="."&&(n=p$1.resolve(o,n)),p$1.isAbsolute(n)){if(E(i,n)){if(P(i,n).isFile())return n}else if(!n.endsWith(".json")){const T=`${n}.json`;if(E(i,T))return T}return}const[t,...l]=e.split("/"),s=t[0]==="@"?`${t}/${l.shift()}`:t,m=l.join("/"),r=Oe();if(r){const{resolveRequest:T}=r;try{if(s===e){const w=T(p$1.join(s,G),o);if(w){const k=R(w,m,!1,i);if(k&&E(i,k))return k}}else {let w;try{w=T(e,o,{extensions:[".json"]});}catch{w=T(p$1.join(e,z),o);}if(w)return w}}catch{}}const b=Z(o,p$1.join("node_modules",s),i);if(!b||!P(i,b).isDirectory())return;const v=p$1.join(b,G);if(E(i,v)){const T=R(v,m,!1,i);if(T===!1)return;if(T&&E(i,T)&&P(i,T).isFile())return T}const c=p$1.join(b,m),L=c.endsWith(".json");if(!L){const T=`${c}.json`;if(E(i,T))return T}if(E(i,c)){if(P(i,c).isDirectory()){const T=p$1.join(c,G);if(E(i,T)){const k=R(T,"",!0,i);if(k&&E(i,k))return k}const w=p$1.join(c,z);if(E(i,w))return w}else if(L)return c}},je=(e,o,i,n)=>{const t=Ae(e,o,n);if(!t)throw new Error(`File '${e}' not found.`);if(i.has(t))throw new Error(`Circularity detected while resolving configuration: ${t}`);i.add(t);const l=p$1.dirname(t),s=te(t,n,i);delete s.references;const{compilerOptions:m}=s;if(m){const r=["baseUrl","outDir"];for(const b of r){const v=m[b];v&&(m[b]=B(p$1.relative(o,p$1.join(l,v)))||"./");}}return s.files&&(s.files=s.files.map(r=>B(p$1.relative(o,p$1.join(l,r))))),s.include&&(s.include=s.include.map(r=>B(p$1.relative(o,p$1.join(l,r))))),s.exclude&&(s.exclude=s.exclude.map(r=>B(p$1.relative(o,p$1.join(l,r))))),s},te=(e,o,i=new Set)=>{let n;try{n=ae(o,e);}catch{throw new Error(`Cannot resolve tsconfig at path: ${e}`)}let t=ne(n,o)||{};if(typeof t!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const l=p$1.dirname(n);if(t.compilerOptions){const{compilerOptions:s}=t;s.paths&&!s.baseUrl&&(s[M]=l);}if(t.extends){const s=Array.isArray(t.extends)?t.extends:[t.extends];delete t.extends;for(const m of s.reverse()){const r=je(m,l,new Set(i),o),b={...r,...t,compilerOptions:{...r.compilerOptions,...t.compilerOptions}};r.watchOptions&&(b.watchOptions={...r.watchOptions,...t.watchOptions}),t=b;}}if(t.compilerOptions){const{compilerOptions:s}=t,m=["baseUrl","rootDir"];for(const b of m){const v=s[b];if(v){const c=p$1.resolve(l,v),L=W(p$1.relative(l,c));s[b]=L;}}const{outDir:r}=s;r&&(Array.isArray(t.exclude)||(t.exclude=[]),t.exclude.includes(r)||t.exclude.push(r),s.outDir=W(r));}else t.compilerOptions={};if(t.files&&(t.files=t.files.map(W)),t.include&&(t.include=t.include.map(B)),t.watchOptions){const{watchOptions:s}=t;s.excludeDirectories&&(s.excludeDirectories=s.excludeDirectories.map(m=>B(p$1.resolve(l,m))));}return t},ie=(e,o=new Map)=>te(e,o),$e=(e=process.cwd(),o="tsconfig.json",i=new Map)=>{const n=Z(B(e),o,i);if(!n)return null;const t=ie(n,i);return {path:n,config:t}};p$1.posix;process.platform==="win32";
|
|
229
251
|
|
|
230
252
|
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
|
231
253
|
const newLineRegExp = /\r?\n/;
|
|
@@ -1009,8 +1031,12 @@ ${c.cyan(c.inverse(c.bold(" BENCH ")))} ${c.cyan("Summary")}
|
|
|
1009
1031
|
logger.log(` ${bench.name}${c.dim(` - ${groupName}`)}`);
|
|
1010
1032
|
const siblings = group.tasks.filter((i) => {
|
|
1011
1033
|
var _a2;
|
|
1012
|
-
return ((_a2 = i.result) == null ? void 0 : _a2.benchmark) && i !== bench;
|
|
1034
|
+
return i.meta.benchmark && ((_a2 = i.result) == null ? void 0 : _a2.benchmark) && i !== bench;
|
|
1013
1035
|
}).sort((a, b) => a.result.benchmark.rank - b.result.benchmark.rank);
|
|
1036
|
+
if (siblings.length === 0) {
|
|
1037
|
+
logger.log("");
|
|
1038
|
+
continue;
|
|
1039
|
+
}
|
|
1014
1040
|
for (const sibling of siblings) {
|
|
1015
1041
|
const number = `${(sibling.result.benchmark.mean / bench.result.benchmark.mean).toFixed(2)}x`;
|
|
1016
1042
|
logger.log(` ${c.green(number)} ${c.gray("faster than")} ${sibling.name}`);
|
|
@@ -2340,14 +2366,6 @@ class DotReporter extends BaseReporter {
|
|
|
2340
2366
|
}
|
|
2341
2367
|
}
|
|
2342
2368
|
|
|
2343
|
-
function getOutputFile(config, reporter) {
|
|
2344
|
-
if (!(config == null ? void 0 : config.outputFile))
|
|
2345
|
-
return;
|
|
2346
|
-
if (typeof config.outputFile === "string")
|
|
2347
|
-
return config.outputFile;
|
|
2348
|
-
return config.outputFile[reporter];
|
|
2349
|
-
}
|
|
2350
|
-
|
|
2351
2369
|
const StatusMap = {
|
|
2352
2370
|
fail: "failed",
|
|
2353
2371
|
only: "pending",
|
|
@@ -3088,7 +3106,7 @@ function generateCodeFrame(source, indent = 0, loc, range = 2) {
|
|
|
3088
3106
|
if (j < 0 || j >= lines.length)
|
|
3089
3107
|
continue;
|
|
3090
3108
|
const lineLength = lines[j].length;
|
|
3091
|
-
if (
|
|
3109
|
+
if (stripAnsi(lines[j]).length > 200)
|
|
3092
3110
|
return "";
|
|
3093
3111
|
res.push(lineNo(j + 1) + cliTruncate(lines[j].replace(/\t/g, " "), columns - 5 - indent));
|
|
3094
3112
|
if (j === i) {
|
|
@@ -4310,7 +4328,7 @@ createLogUpdate(process$2.stdout);
|
|
|
4310
4328
|
|
|
4311
4329
|
createLogUpdate(process$2.stderr);
|
|
4312
4330
|
|
|
4313
|
-
var version = "1.
|
|
4331
|
+
var version = "1.5.0";
|
|
4314
4332
|
|
|
4315
4333
|
const HIGHLIGHT_SUPPORTED_EXTS = new Set(["js", "ts"].flatMap((lang) => [
|
|
4316
4334
|
`.${lang}`,
|
|
@@ -4409,14 +4427,14 @@ class Logger {
|
|
|
4409
4427
|
this.console.warn(...args);
|
|
4410
4428
|
}
|
|
4411
4429
|
clearFullScreen(message) {
|
|
4412
|
-
if (this.ctx.
|
|
4430
|
+
if (!this.ctx.config.clearScreen) {
|
|
4413
4431
|
this.console.log(message);
|
|
4414
4432
|
return;
|
|
4415
4433
|
}
|
|
4416
4434
|
this.console.log(`${ERASE_SCROLLBACK}${CLEAR_SCREEN}${message}`);
|
|
4417
4435
|
}
|
|
4418
4436
|
clearScreen(message, force = false) {
|
|
4419
|
-
if (this.ctx.
|
|
4437
|
+
if (!this.ctx.config.clearScreen) {
|
|
4420
4438
|
this.console.log(message);
|
|
4421
4439
|
return;
|
|
4422
4440
|
}
|
|
@@ -4493,7 +4511,7 @@ No ${config.mode} files found, exiting with code 1`));
|
|
|
4493
4511
|
}
|
|
4494
4512
|
}
|
|
4495
4513
|
printBanner() {
|
|
4496
|
-
var _a, _b
|
|
4514
|
+
var _a, _b;
|
|
4497
4515
|
this.log();
|
|
4498
4516
|
const versionTest = this.ctx.config.watch ? c.blue(`v${version}`) : c.cyan(`v${version}`);
|
|
4499
4517
|
const mode = this.ctx.config.watch ? c.blue(" DEV ") : c.cyan(" RUN ");
|
|
@@ -4509,10 +4527,14 @@ No ${config.mode} files found, exiting with code 1`));
|
|
|
4509
4527
|
const origin = (resolvedUrls == null ? void 0 : resolvedUrls.local[0]) ?? (resolvedUrls == null ? void 0 : resolvedUrls.network[0]);
|
|
4510
4528
|
this.log(c.dim(c.green(` ${output} Browser runner started at ${new URL("/", origin)}`)));
|
|
4511
4529
|
});
|
|
4512
|
-
if (this.ctx.config.ui)
|
|
4530
|
+
if (this.ctx.config.ui) {
|
|
4513
4531
|
this.log(c.dim(c.green(` UI started at http://${((_a = this.ctx.config.api) == null ? void 0 : _a.host) || "localhost"}:${c.bold(`${this.ctx.server.config.server.port}`)}${this.ctx.config.uiBase}`)));
|
|
4514
|
-
else if ((_b = this.ctx.config.api) == null ? void 0 : _b.port)
|
|
4515
|
-
|
|
4532
|
+
} else if ((_b = this.ctx.config.api) == null ? void 0 : _b.port) {
|
|
4533
|
+
const resolvedUrls = this.ctx.server.resolvedUrls;
|
|
4534
|
+
const fallbackUrl = `http://${this.ctx.config.api.host || "localhost"}:${this.ctx.config.api.port}`;
|
|
4535
|
+
const origin = (resolvedUrls == null ? void 0 : resolvedUrls.local[0]) ?? (resolvedUrls == null ? void 0 : resolvedUrls.network[0]) ?? fallbackUrl;
|
|
4536
|
+
this.log(c.dim(c.green(` API started at ${new URL("/", origin)}`)));
|
|
4537
|
+
}
|
|
4516
4538
|
if (this.ctx.coverageProvider)
|
|
4517
4539
|
this.log(c.dim(" Coverage enabled with ") + c.yellow(this.ctx.coverageProvider.name));
|
|
4518
4540
|
this.log();
|
|
@@ -4772,7 +4794,7 @@ function renderBenchmark(task, tasks) {
|
|
|
4772
4794
|
result.rank === 1 ? c.bold(c.green(" fastest")) : result.rank === benches.length && benches.length > 2 ? c.bold(c.gray(" slowest")) : ""
|
|
4773
4795
|
].join(" ");
|
|
4774
4796
|
}
|
|
4775
|
-
function renderTree(tasks, options, level = 0) {
|
|
4797
|
+
function renderTree(tasks, options, level = 0, shallow = false) {
|
|
4776
4798
|
var _a, _b, _c, _d, _e, _f;
|
|
4777
4799
|
const output = [];
|
|
4778
4800
|
let idx = 0;
|
|
@@ -4811,7 +4833,7 @@ ${padding}`;
|
|
|
4811
4833
|
output.push(` ${c.gray(cliTruncate(out, getCols(-3)))}`);
|
|
4812
4834
|
}
|
|
4813
4835
|
}
|
|
4814
|
-
if (task.type === "suite" && task.tasks.length > 0) {
|
|
4836
|
+
if (!shallow && task.type === "suite" && task.tasks.length > 0) {
|
|
4815
4837
|
if ((_f = task.result) == null ? void 0 : _f.state)
|
|
4816
4838
|
output.push(renderTree(task.tasks, options, level + 1));
|
|
4817
4839
|
}
|
|
@@ -4878,6 +4900,27 @@ class TableReporter extends BaseReporter {
|
|
|
4878
4900
|
this.renderer.update(files);
|
|
4879
4901
|
}
|
|
4880
4902
|
}
|
|
4903
|
+
onTaskUpdate(packs) {
|
|
4904
|
+
var _a, _b;
|
|
4905
|
+
if (this.isTTY)
|
|
4906
|
+
return;
|
|
4907
|
+
for (const pack of packs) {
|
|
4908
|
+
const task = this.ctx.state.idMap.get(pack[0]);
|
|
4909
|
+
if (task && task.type === "suite" && ((_a = task.result) == null ? void 0 : _a.state) && ((_b = task.result) == null ? void 0 : _b.state) !== "run") {
|
|
4910
|
+
const benches = task.tasks.filter((t) => t.meta.benchmark);
|
|
4911
|
+
if (benches.length > 0 && benches.every((t) => {
|
|
4912
|
+
var _a2;
|
|
4913
|
+
return ((_a2 = t.result) == null ? void 0 : _a2.state) !== "run";
|
|
4914
|
+
})) {
|
|
4915
|
+
let title = ` ${getStateSymbol(task)} ${getFullName(task, c.dim(" > "))}`;
|
|
4916
|
+
if (task.result.duration != null && task.result.duration > this.ctx.config.slowTestThreshold)
|
|
4917
|
+
title += c.yellow(` ${Math.round(task.result.duration)}${c.dim("ms")}`);
|
|
4918
|
+
this.ctx.logger.log(title);
|
|
4919
|
+
this.ctx.logger.log(renderTree(benches, this.rendererOptions, 1, true));
|
|
4920
|
+
}
|
|
4921
|
+
}
|
|
4922
|
+
}
|
|
4923
|
+
}
|
|
4881
4924
|
async onFinished(files = this.ctx.state.getFiles(), errors = this.ctx.state.getUnhandledErrors()) {
|
|
4882
4925
|
await this.stopListRender();
|
|
4883
4926
|
this.ctx.logger.log();
|
|
@@ -4924,4 +4967,4 @@ const ReportersMap = {
|
|
|
4924
4967
|
"github-actions": GithubActionsReporter
|
|
4925
4968
|
};
|
|
4926
4969
|
|
|
4927
|
-
export { BaseSequencer as B, DefaultReporter as D, GithubActionsReporter as G, HangingProcessReporter as H, JsonReporter$1 as J, Logger as L, ReportersMap as R, TapReporter as T, VerboseReporter as V, BasicReporter as a, DotReporter as b, JUnitReporter as c, TapFlatReporter as d, BenchmarkReportsMap as e, Typechecker as f, RandomSequencer as g, generateCodeFrame as h, highlightCode as i, divider as j, stripAnsi as s };
|
|
4970
|
+
export { BaseSequencer as B, DefaultReporter as D, GithubActionsReporter as G, HangingProcessReporter as H, JsonReporter$1 as J, Logger as L, ReportersMap as R, TapReporter as T, VerboseReporter as V, BasicReporter as a, DotReporter as b, JUnitReporter as c, TapFlatReporter as d, BenchmarkReportsMap as e, Typechecker as f, RandomSequencer as g, generateCodeFrame as h, highlightCode as i, divider as j, stripAnsi as s, wrapSerializableConfig as w };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
|
|
3
|
+
const __require = createRequire(import.meta.url);
|
|
4
|
+
let inspector;
|
|
5
|
+
let session;
|
|
6
|
+
function setupInspect(ctx) {
|
|
7
|
+
const config = ctx.config;
|
|
8
|
+
const isEnabled = config.inspector.enabled;
|
|
9
|
+
if (isEnabled) {
|
|
10
|
+
inspector = __require("node:inspector");
|
|
11
|
+
const isOpen = inspector.url() !== void 0;
|
|
12
|
+
if (!isOpen) {
|
|
13
|
+
inspector.open(
|
|
14
|
+
config.inspector.port,
|
|
15
|
+
config.inspector.host,
|
|
16
|
+
config.inspector.waitForDebugger
|
|
17
|
+
);
|
|
18
|
+
if (config.inspectBrk) {
|
|
19
|
+
const firstTestFile = ctx.files[0];
|
|
20
|
+
if (firstTestFile) {
|
|
21
|
+
session = new inspector.Session();
|
|
22
|
+
session.connect();
|
|
23
|
+
session.post("Debugger.enable");
|
|
24
|
+
session.post("Debugger.setBreakpointByUrl", {
|
|
25
|
+
lineNumber: 0,
|
|
26
|
+
url: new URL(firstTestFile, import.meta.url).href
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const keepOpen = shouldKeepOpen(config);
|
|
33
|
+
return function cleanup() {
|
|
34
|
+
if (isEnabled && !keepOpen && inspector) {
|
|
35
|
+
inspector.close();
|
|
36
|
+
session == null ? void 0 : session.disconnect();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function closeInspector(config) {
|
|
41
|
+
const keepOpen = shouldKeepOpen(config);
|
|
42
|
+
if (inspector && !keepOpen) {
|
|
43
|
+
inspector.close();
|
|
44
|
+
session == null ? void 0 : session.disconnect();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function shouldKeepOpen(config) {
|
|
48
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
49
|
+
const isIsolatedSingleThread = config.pool === "threads" && ((_b = (_a = config.poolOptions) == null ? void 0 : _a.threads) == null ? void 0 : _b.isolate) === false && ((_d = (_c = config.poolOptions) == null ? void 0 : _c.threads) == null ? void 0 : _d.singleThread);
|
|
50
|
+
const isIsolatedSingleFork = config.pool === "forks" && ((_f = (_e = config.poolOptions) == null ? void 0 : _e.forks) == null ? void 0 : _f.isolate) === false && ((_h = (_g = config.poolOptions) == null ? void 0 : _g.forks) == null ? void 0 : _h.singleFork);
|
|
51
|
+
return config.watch && (isIsolatedSingleFork || isIsolatedSingleThread);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { closeInspector as c, setupInspect as s };
|
|
@@ -6,17 +6,24 @@ let globalSetup = false;
|
|
|
6
6
|
async function setupCommonEnv(config) {
|
|
7
7
|
resetRunOnceCounter();
|
|
8
8
|
setupDefines(config.defines);
|
|
9
|
+
setupEnv(config.env);
|
|
9
10
|
if (globalSetup)
|
|
10
11
|
return;
|
|
11
12
|
globalSetup = true;
|
|
12
13
|
setSafeTimers();
|
|
13
14
|
if (config.globals)
|
|
14
|
-
(await import('../chunks/integrations-globals.
|
|
15
|
+
(await import('../chunks/integrations-globals.2J_Aii2q.js')).registerApiGlobally();
|
|
15
16
|
}
|
|
16
17
|
function setupDefines(defines) {
|
|
17
18
|
for (const key in defines)
|
|
18
19
|
globalThis[key] = defines[key];
|
|
19
20
|
}
|
|
21
|
+
function setupEnv(env) {
|
|
22
|
+
if (typeof process === "undefined")
|
|
23
|
+
return;
|
|
24
|
+
for (const key in env)
|
|
25
|
+
process.env[key] = env[key];
|
|
26
|
+
}
|
|
20
27
|
async function loadDiffConfig(config, executor) {
|
|
21
28
|
if (typeof config.diff !== "string")
|
|
22
29
|
return;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { parseRegexp } from '@vitest/utils';
|
|
2
|
+
|
|
3
|
+
var _a, _b;
|
|
4
|
+
const REGEXP_WRAP_PREFIX = "$$vitest:";
|
|
5
|
+
const processSend = (_a = process.send) == null ? void 0 : _a.bind(process);
|
|
6
|
+
const processOn = (_b = process.on) == null ? void 0 : _b.bind(process);
|
|
7
|
+
function createThreadsRpcOptions({ port }) {
|
|
8
|
+
return {
|
|
9
|
+
post: (v) => {
|
|
10
|
+
port.postMessage(v);
|
|
11
|
+
},
|
|
12
|
+
on: (fn) => {
|
|
13
|
+
port.addListener("message", fn);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function createForksRpcOptions(nodeV8) {
|
|
18
|
+
return {
|
|
19
|
+
serialize: nodeV8.serialize,
|
|
20
|
+
deserialize: (v) => nodeV8.deserialize(Buffer.from(v)),
|
|
21
|
+
post(v) {
|
|
22
|
+
processSend(v);
|
|
23
|
+
},
|
|
24
|
+
on(fn) {
|
|
25
|
+
processOn("message", (message, ...extras) => {
|
|
26
|
+
if (message == null ? void 0 : message.__tinypool_worker_message__)
|
|
27
|
+
return;
|
|
28
|
+
return fn(message, ...extras);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function unwrapSerializableConfig(config) {
|
|
34
|
+
if (config.testNamePattern && typeof config.testNamePattern === "string") {
|
|
35
|
+
const testNamePattern = config.testNamePattern;
|
|
36
|
+
if (testNamePattern.startsWith(REGEXP_WRAP_PREFIX))
|
|
37
|
+
config.testNamePattern = parseRegexp(testNamePattern.slice(REGEXP_WRAP_PREFIX.length));
|
|
38
|
+
}
|
|
39
|
+
if (config.defines && Array.isArray(config.defines.keys) && config.defines.original) {
|
|
40
|
+
const { keys, original } = config.defines;
|
|
41
|
+
const defines = {};
|
|
42
|
+
for (const key of keys)
|
|
43
|
+
defines[key] = original[key];
|
|
44
|
+
config.defines = defines;
|
|
45
|
+
}
|
|
46
|
+
return config;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { createThreadsRpcOptions as a, createForksRpcOptions as c, unwrapSerializableConfig as u };
|
|
@@ -9,7 +9,7 @@ import { g as getFullName } from './tasks.IknbGB2n.js';
|
|
|
9
9
|
import { g as getWorkerState, a as getCurrentEnvironment } from './global.CkGT_TMy.js';
|
|
10
10
|
import { getSafeTimers, assertTypes, createSimpleStackTrace } from '@vitest/utils';
|
|
11
11
|
import { parseSingleStack } from '@vitest/utils/source-map';
|
|
12
|
-
import { i as isChildProcess } from './base.
|
|
12
|
+
import { i as isChildProcess } from './base.Xt0Omgh7.js';
|
|
13
13
|
import { R as RealDate, r as resetDate, m as mockDate } from './date.Ns1pGd_X.js';
|
|
14
14
|
import { spyOn, fn, isMockFunction, mocks } from '@vitest/spy';
|
|
15
15
|
|
|
@@ -221,6 +221,9 @@ const SnapshotPlugin = (chai, utils) => {
|
|
|
221
221
|
chai.Assertion.prototype,
|
|
222
222
|
key,
|
|
223
223
|
function(properties, message) {
|
|
224
|
+
const isNot = utils.flag(this, "negate");
|
|
225
|
+
if (isNot)
|
|
226
|
+
throw new Error(`${key} cannot be used with "not"`);
|
|
224
227
|
const expected = utils.flag(this, "object");
|
|
225
228
|
const test = utils.flag(this, "vitest-test");
|
|
226
229
|
if (typeof properties === "string" && typeof message === "undefined") {
|
|
@@ -243,6 +246,9 @@ const SnapshotPlugin = (chai, utils) => {
|
|
|
243
246
|
chai.Assertion.prototype,
|
|
244
247
|
"toMatchFileSnapshot",
|
|
245
248
|
function(file, message) {
|
|
249
|
+
const isNot = utils.flag(this, "negate");
|
|
250
|
+
if (isNot)
|
|
251
|
+
throw new Error('toMatchFileSnapshot cannot be used with "not"');
|
|
246
252
|
const expected = utils.flag(this, "object");
|
|
247
253
|
const test = utils.flag(this, "vitest-test");
|
|
248
254
|
const errorMessage = utils.flag(this, "message");
|
|
@@ -264,6 +270,9 @@ const SnapshotPlugin = (chai, utils) => {
|
|
|
264
270
|
"toMatchInlineSnapshot",
|
|
265
271
|
function __INLINE_SNAPSHOT__(properties, inlineSnapshot, message) {
|
|
266
272
|
var _a;
|
|
273
|
+
const isNot = utils.flag(this, "negate");
|
|
274
|
+
if (isNot)
|
|
275
|
+
throw new Error('toMatchInlineSnapshot cannot be used with "not"');
|
|
267
276
|
const test = utils.flag(this, "vitest-test");
|
|
268
277
|
const isInsideEach = test && (test.each || ((_a = test.suite) == null ? void 0 : _a.each));
|
|
269
278
|
if (isInsideEach)
|
|
@@ -294,6 +303,9 @@ const SnapshotPlugin = (chai, utils) => {
|
|
|
294
303
|
chai.Assertion.prototype,
|
|
295
304
|
"toThrowErrorMatchingSnapshot",
|
|
296
305
|
function(message) {
|
|
306
|
+
const isNot = utils.flag(this, "negate");
|
|
307
|
+
if (isNot)
|
|
308
|
+
throw new Error('toThrowErrorMatchingSnapshot cannot be used with "not"');
|
|
297
309
|
const expected = utils.flag(this, "object");
|
|
298
310
|
const test = utils.flag(this, "vitest-test");
|
|
299
311
|
const promise = utils.flag(this, "promise");
|
|
@@ -311,6 +323,9 @@ const SnapshotPlugin = (chai, utils) => {
|
|
|
311
323
|
"toThrowErrorMatchingInlineSnapshot",
|
|
312
324
|
function __INLINE_SNAPSHOT__(inlineSnapshot, message) {
|
|
313
325
|
var _a;
|
|
326
|
+
const isNot = utils.flag(this, "negate");
|
|
327
|
+
if (isNot)
|
|
328
|
+
throw new Error('toThrowErrorMatchingInlineSnapshot cannot be used with "not"');
|
|
314
329
|
const test = utils.flag(this, "vitest-test");
|
|
315
330
|
const isInsideEach = test && (test.each || ((_a = test.suite) == null ? void 0 : _a.each));
|
|
316
331
|
if (isInsideEach)
|
|
@@ -3315,10 +3330,11 @@ function createVitest() {
|
|
|
3315
3330
|
let _mockedDate = null;
|
|
3316
3331
|
let _config = null;
|
|
3317
3332
|
const workerState = getWorkerState();
|
|
3318
|
-
|
|
3333
|
+
let _timers;
|
|
3334
|
+
const timers = () => _timers || (_timers = new FakeTimers({
|
|
3319
3335
|
global: globalThis,
|
|
3320
3336
|
config: workerState.config.fakeTimers
|
|
3321
|
-
});
|
|
3337
|
+
}));
|
|
3322
3338
|
const _stubsGlobal = /* @__PURE__ */ new Map();
|
|
3323
3339
|
const _stubsEnv = /* @__PURE__ */ new Map();
|
|
3324
3340
|
const getImporter = () => {
|
|
@@ -3338,73 +3354,73 @@ function createVitest() {
|
|
|
3338
3354
|
}
|
|
3339
3355
|
}
|
|
3340
3356
|
if (config)
|
|
3341
|
-
|
|
3357
|
+
timers().configure({ ...workerState.config.fakeTimers, ...config });
|
|
3342
3358
|
else
|
|
3343
|
-
|
|
3344
|
-
|
|
3359
|
+
timers().configure(workerState.config.fakeTimers);
|
|
3360
|
+
timers().useFakeTimers();
|
|
3345
3361
|
return utils;
|
|
3346
3362
|
},
|
|
3347
3363
|
isFakeTimers() {
|
|
3348
|
-
return
|
|
3364
|
+
return timers().isFakeTimers();
|
|
3349
3365
|
},
|
|
3350
3366
|
useRealTimers() {
|
|
3351
|
-
|
|
3367
|
+
timers().useRealTimers();
|
|
3352
3368
|
_mockedDate = null;
|
|
3353
3369
|
return utils;
|
|
3354
3370
|
},
|
|
3355
3371
|
runOnlyPendingTimers() {
|
|
3356
|
-
|
|
3372
|
+
timers().runOnlyPendingTimers();
|
|
3357
3373
|
return utils;
|
|
3358
3374
|
},
|
|
3359
3375
|
async runOnlyPendingTimersAsync() {
|
|
3360
|
-
await
|
|
3376
|
+
await timers().runOnlyPendingTimersAsync();
|
|
3361
3377
|
return utils;
|
|
3362
3378
|
},
|
|
3363
3379
|
runAllTimers() {
|
|
3364
|
-
|
|
3380
|
+
timers().runAllTimers();
|
|
3365
3381
|
return utils;
|
|
3366
3382
|
},
|
|
3367
3383
|
async runAllTimersAsync() {
|
|
3368
|
-
await
|
|
3384
|
+
await timers().runAllTimersAsync();
|
|
3369
3385
|
return utils;
|
|
3370
3386
|
},
|
|
3371
3387
|
runAllTicks() {
|
|
3372
|
-
|
|
3388
|
+
timers().runAllTicks();
|
|
3373
3389
|
return utils;
|
|
3374
3390
|
},
|
|
3375
3391
|
advanceTimersByTime(ms) {
|
|
3376
|
-
|
|
3392
|
+
timers().advanceTimersByTime(ms);
|
|
3377
3393
|
return utils;
|
|
3378
3394
|
},
|
|
3379
3395
|
async advanceTimersByTimeAsync(ms) {
|
|
3380
|
-
await
|
|
3396
|
+
await timers().advanceTimersByTimeAsync(ms);
|
|
3381
3397
|
return utils;
|
|
3382
3398
|
},
|
|
3383
3399
|
advanceTimersToNextTimer() {
|
|
3384
|
-
|
|
3400
|
+
timers().advanceTimersToNextTimer();
|
|
3385
3401
|
return utils;
|
|
3386
3402
|
},
|
|
3387
3403
|
async advanceTimersToNextTimerAsync() {
|
|
3388
|
-
await
|
|
3404
|
+
await timers().advanceTimersToNextTimerAsync();
|
|
3389
3405
|
return utils;
|
|
3390
3406
|
},
|
|
3391
3407
|
getTimerCount() {
|
|
3392
|
-
return
|
|
3408
|
+
return timers().getTimerCount();
|
|
3393
3409
|
},
|
|
3394
3410
|
setSystemTime(time) {
|
|
3395
3411
|
const date = time instanceof Date ? time : new Date(time);
|
|
3396
3412
|
_mockedDate = date;
|
|
3397
|
-
|
|
3413
|
+
timers().setSystemTime(date);
|
|
3398
3414
|
return utils;
|
|
3399
3415
|
},
|
|
3400
3416
|
getMockedSystemTime() {
|
|
3401
3417
|
return _mockedDate;
|
|
3402
3418
|
},
|
|
3403
3419
|
getRealSystemTime() {
|
|
3404
|
-
return
|
|
3420
|
+
return timers().getRealSystemTime();
|
|
3405
3421
|
},
|
|
3406
3422
|
clearAllTimers() {
|
|
3407
|
-
|
|
3423
|
+
timers().clearAllTimers();
|
|
3408
3424
|
return utils;
|
|
3409
3425
|
},
|
|
3410
3426
|
// mocks
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import vm, { isContext } from 'node:vm';
|
|
2
2
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
3
3
|
import { dirname, basename, extname, normalize, join, resolve } from 'pathe';
|
|
4
|
-
import { createCustomConsole } from '../chunks/runtime-console.
|
|
5
|
-
import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.
|
|
4
|
+
import { createCustomConsole } from '../chunks/runtime-console.kbFEN7E-.js';
|
|
5
|
+
import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.2_yoIC01.js';
|
|
6
6
|
import { distDir } from '../path.js';
|
|
7
7
|
import { dirname as dirname$1 } from 'node:path';
|
|
8
8
|
import { statSync, existsSync, readFileSync } from 'node:fs';
|
|
@@ -691,7 +691,7 @@ async function runVmTests(state) {
|
|
|
691
691
|
provideWorkerState(context, state);
|
|
692
692
|
context.process = process;
|
|
693
693
|
context.global = context;
|
|
694
|
-
context.console = state.config.disableConsoleIntercept ? console : createCustomConsole(
|
|
694
|
+
context.console = state.config.disableConsoleIntercept ? console : createCustomConsole();
|
|
695
695
|
context.setImmediate = setImmediate;
|
|
696
696
|
context.clearImmediate = clearImmediate;
|
|
697
697
|
const stubs = getDefaultRequestStubs(context);
|