vitest 0.0.37 → 0.0.38

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.
Files changed (2) hide show
  1. package/dist/node/cli.js +4 -4
  2. package/package.json +1 -1
package/dist/node/cli.js CHANGED
@@ -1,7 +1,7 @@
1
- import{f as g}from"../chunk-XPSQDVUG.js";g();import{fileURLToPath as H}from"url";import{resolve as w,dirname as Q}from"path";import{findUp as G}from"find-up";import K from"sade";import v from"picocolors";var C="0.0.37";g();import{createServer as L,mergeConfig as J}from"vite";g();import{builtinModules as F,createRequire as A}from"module";import{fileURLToPath as D,pathToFileURL as N}from"url";import{dirname as E,resolve as V}from"path";import W from"vm";var $={"/@vite/client":{injectQuery:e=>e,createHotContext(){return{accept:()=>{},prune:()=>{}}},updateStyle(){}}};async function T({moduleCache:e,root:s,files:r,fetch:o,inline:p,external:c}){let h=[];for(let t of r)h.push(await u(`/@fs/${b(V(t))}`,[]));return h;async function y(t,n,i){i=[...i,t];let a=async f=>{if(i.includes(f)){if(!e.get(f))throw new Error(`Circular dependency detected
1
+ import{f as g}from"../chunk-XPSQDVUG.js";g();import{fileURLToPath as H}from"url";import{resolve as w,dirname as Q}from"path";import{findUp as G}from"find-up";import K from"sade";import v from"picocolors";var C="0.0.38";g();import{createServer as L,mergeConfig as J}from"vite";g();import{builtinModules as F,createRequire as A}from"module";import{fileURLToPath as D,pathToFileURL as N}from"url";import{dirname as E,resolve as V}from"path";import W from"vm";var $={"/@vite/client":{injectQuery:e=>e,createHotContext(){return{accept:()=>{},prune:()=>{}}},updateStyle(){}}};async function T({moduleCache:e,root:s,files:r,fetch:i,inline:p,external:c}){let h=[];for(let t of r)h.push(await u(`/@fs/${b(V(t))}`,[]));return h;async function y(t,n,o){o=[...o,t];let a=async f=>{if(o.includes(f)){if(!e.get(f))throw new Error(`Circular dependency detected
2
2
  Stack:
3
- ${[...i,f].reverse().map(I=>`- ${I}`).join(`
4
- `)}`);return e.get(f).exports}return u(f,i)};if(t in $)return $[t];let d=await o(t);if(!d)throw new Error(`failed to load ${t}`);let m=N(n),l={};_(t,{transformResult:d,exports:l});let j=D(m),R={require:A(m),__filename:j,__dirname:E(j),__vite_ssr_import__:a,__vite_ssr_dynamic_import__:a,__vite_ssr_exports__:l,__vite_ssr_exportAll__:f=>q(l,f),__vite_ssr_import_meta__:{url:m}};return await W.runInThisContext(`async (${Object.keys(R).join(",")}) => { ${d.code} }`,{filename:n,lineOffset:0})(...Object.values(R)),l}function _(t,n){e.has(t)?Object.assign(e.get(t),n):e.set(t,n)}function x(t){for(let n of p)if(typeof n=="string"){if(t.includes(`/node_modules/${n}/`))return!1}else if(n.test(t))return!1;for(let n of c)if(typeof n=="string"){if(t.includes(`/node_modules/${n}/`))return!0}else if(n.test(t))return!0;return t.includes("/node_modules/")}async function u(t,n){var m,l;let i=k(t);if(F.includes(i))return import(i);let a=U(i,s);if(x(a))return a.match(/^\w:\//)?import(`/${a}`):import(a);if((m=e.get(a))==null?void 0:m.promise)return(l=e.get(a))==null?void 0:l.promise;let d=y(i,a,n);return _(a,{promise:d}),await d}function q(t,n){for(let i in n)if(i!=="default")try{Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get(){return n[i]}})}catch{}}}function k(e){return e&&e.startsWith("/@id/__x00__")&&(e=`\0${e.slice("/@id/__x00__".length)}`),e&&e.startsWith("/@id/")&&(e=e.slice("/@id/".length)),e.startsWith("__vite-browser-external:")&&(e=e.slice("__vite-browser-external:".length)),e}function U(e,s){let r=b(e).startsWith("/@fs/")?e.slice(4):e.startsWith(E(s))?e:e.startsWith("/")?b(V(s,e.slice(1))):e;return r.startsWith("//")&&(r=r.slice(1)),r}function b(e){return e.replace(/\\/g,"/")}var M=new Map;async function P(e){var h,y,_,x;process.exitCode=0;let s=e.root||process.cwd();process.chdir(s);let r=e.files||e._;e.shouldExternalize=e.shouldExternalize||(u=>u.includes("/node_modules/"));let o=await L(J(e.defaultConfig||{},{logLevel:"error",clearScreen:!1,configFile:e.config,root:s,resolve:{}}));await o.pluginContainer.buildStart({}),process.__vite_node__={server:o,moduleCache:M};let p=["vue","@vue","diff"],c={root:o.config.root,files:r,fetch:u=>B(o,u),inline:["vitest",...p,...((y=(h=o.config.test)==null?void 0:h.deps)==null?void 0:y.inline)||[]],external:((x=(_=o.config.test)==null?void 0:_.deps)==null?void 0:x.external)||[],moduleCache:M};try{await T(c)}catch(u){throw process.exitCode=1,u}finally{process.__vite_node__.watch||await o.close()}}async function B(e,s){if(s.match(/\.(?:[cm]?[jt]sx?|json)$/))return await e.transformRequest(s,{ssr:!0});{let r=await e.transformRequest(s);return r?await e.ssrTransform(r.code,r.map,s):void 0}}K("vitest [filter]",!0).version(C).describe("A blazing fast unit test framework powered by Vite.").option("-r, --root","root path",process.cwd()).option("-c, --config","path to config file").option("-w, --watch","watch mode",!1).option("-u, --update","update snapshot",!1).option("--global","inject apis globally",!1).option("--dev","dev mode",!1).option("--dom","mock browser api using jsdom or happy-dom","").action(async(e,s)=>{process.env.VITEST="true",console.log(v.yellow(v.bold(`
3
+ ${[...o,f].reverse().map(I=>`- ${I}`).join(`
4
+ `)}`);return e.get(f).exports}return u(f,o)};if(t in $)return $[t];let d=await i(t);if(!d)throw new Error(`failed to load ${t}`);let m=N(n),l={};_(t,{transformResult:d,exports:l});let j=D(m),R={require:A(m),__filename:j,__dirname:E(j),__vite_ssr_import__:a,__vite_ssr_dynamic_import__:a,__vite_ssr_exports__:l,__vite_ssr_exportAll__:f=>q(l,f),__vite_ssr_import_meta__:{url:m}};return await W.runInThisContext(`async (${Object.keys(R).join(",")}) => { ${d.code} }`,{filename:n,lineOffset:0})(...Object.values(R)),l}function _(t,n){e.has(t)?Object.assign(e.get(t),n):e.set(t,n)}function x(t){for(let n of p)if(typeof n=="string"){if(t.includes(`/node_modules/${n}/`))return!1}else if(n.test(t))return!1;for(let n of c)if(typeof n=="string"){if(t.includes(`/node_modules/${n}/`))return!0}else if(n.test(t))return!0;return t.includes("/node_modules/")}async function u(t,n){var m,l;let o=k(t);if(F.includes(o))return import(o);let a=U(o,s);if(x(a))return a.match(/^\w:\//)?import(`/${a}`):import(a);if((m=e.get(a))==null?void 0:m.promise)return(l=e.get(a))==null?void 0:l.promise;let d=y(o,a,n);return _(a,{promise:d}),await d}function q(t,n){for(let o in n)if(o!=="default")try{Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get(){return n[o]}})}catch{}}}function k(e){return e&&e.startsWith("/@id/__x00__")&&(e=`\0${e.slice("/@id/__x00__".length)}`),e&&e.startsWith("/@id/")&&(e=e.slice("/@id/".length)),e.startsWith("__vite-browser-external:")&&(e=e.slice("__vite-browser-external:".length)),e}function U(e,s){let r=b(e).startsWith("/@fs/")?e.slice(4):e.startsWith(E(s))?e:e.startsWith("/")?b(V(s,e.slice(1))):e;return r.startsWith("//")&&(r=r.slice(1)),r}function b(e){return e.replace(/\\/g,"/")}var M=new Map;async function P(e){var h,y,_,x;process.exitCode=0;let s=e.root||process.cwd();process.chdir(s);let r=e.files||e._;e.shouldExternalize=e.shouldExternalize||(u=>u.includes("/node_modules/"));let i=await L(J(e.defaultConfig||{},{logLevel:"error",clearScreen:!1,configFile:e.config,root:s,resolve:{}}));await i.pluginContainer.buildStart({}),process.__vite_node__={server:i,moduleCache:M};let p=["vitest/dist","vitest/src","vue","@vue","diff"],c={root:i.config.root,files:r,fetch:u=>B(i,u),inline:[...p,...((y=(h=i.config.test)==null?void 0:h.deps)==null?void 0:y.inline)||[]],external:((x=(_=i.config.test)==null?void 0:_.deps)==null?void 0:x.external)||[],moduleCache:M};try{await T(c)}catch(u){throw process.exitCode=1,u}finally{process.__vite_node__.watch||await i.close()}}async function B(e,s){if(s.match(/\.(?:[cm]?[jt]sx?|json)$/))return await e.transformRequest(s,{ssr:!0});{let r=await e.transformRequest(s);return r?await e.ssrTransform(r.code,r.map,s):void 0}}K("vitest [filter]",!0).version(C).describe("A blazing fast unit test framework powered by Vite.").option("-r, --root","root path",process.cwd()).option("-c, --config","path to config file").option("-w, --watch","watch mode",!1).option("-u, --update","update snapshot",!1).option("--global","inject apis globally",!1).option("--dev","dev mode",!1).option("--dom","mock browser api using jsdom or happy-dom","").action(async(e,s)=>{process.env.VITEST="true",console.log(v.yellow(v.bold(`
5
5
  Vitest is currently in closed beta exclusively for Sponsors`))),console.log(v.magenta(`Become a Sponsor of ${v.underline("https://github.com/sponsors/patak-js")} or ${v.underline("https://github.com/sponsors/antfu")}
6
6
  to access the source code and issues tracker \u{1F496}
7
- `));let r=Q(H(import.meta.url)),o=w(s.root||process.cwd()),p=s.config?w(o,s.config):await G(["vitest.config.ts","vitest.config.js","vitest.config.mjs","vite.config.ts","vite.config.js","vite.config.mjs"],{cwd:o}),c=s;c.config=p,c.root=o,c.filters=e?Array.isArray(e)?e:[e]:void 0,process.__vitest__={options:c},await P({root:o,files:[w(r,s.dev?"../../src/node/entry.ts":"./entry.js")],config:p,defaultConfig:{optimizeDeps:{exclude:["vitest"]}}})}).parse(process.argv);
7
+ `));let r=Q(H(import.meta.url)),i=w(s.root||process.cwd()),p=s.config?w(i,s.config):await G(["vitest.config.ts","vitest.config.js","vitest.config.mjs","vite.config.ts","vite.config.js","vite.config.mjs"],{cwd:i}),c=s;c.config=p,c.root=i,c.filters=e?Array.isArray(e)?e:[e]:void 0,process.__vitest__={options:c},await P({root:i,files:[w(r,s.dev?"../../src/node/entry.ts":"./entry.js")],config:p,defaultConfig:{optimizeDeps:{exclude:["vitest"]}}})}).parse(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "description": "A blazing fast unit test framework powered by Vite",
5
5
  "keywords": [
6
6
  "vite",