@vitest/browser 0.34.1 → 0.34.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.
@@ -17,7 +17,7 @@
17
17
  })()
18
18
  </script>
19
19
  <!-- !LOAD_METADATA! -->
20
- <script type="module" crossorigin src="./assets/index-20e80131.js"></script>
20
+ <script type="module" crossorigin src="./assets/index-8274f3e5.js"></script>
21
21
  <link rel="stylesheet" href="./assets/index-46946a8e.css">
22
22
  </head>
23
23
  <body>
@@ -381,6 +381,16 @@ class StateManager {
381
381
  err.type = type;
382
382
  else
383
383
  err = { type, message: err };
384
+ const _err = err;
385
+ if (_err && typeof _err === "object" && _err.code === "VITEST_PENDING") {
386
+ const task = this.idMap.get(_err.taskId);
387
+ if (task) {
388
+ task.mode = "skip";
389
+ task.result ?? (task.result = { state: "skip" });
390
+ task.result.state = "skip";
391
+ }
392
+ return;
393
+ }
384
394
  this.errorsSet.add(err);
385
395
  }
386
396
  clearErrors() {
@@ -456,6 +466,8 @@ class StateManager {
456
466
  if (task) {
457
467
  task.result = result;
458
468
  task.meta = meta;
469
+ if ((result == null ? void 0 : result.state) === "skip")
470
+ task.mode = "skip";
459
471
  }
460
472
  }
461
473
  }
@@ -661,7 +673,8 @@ function createBrowserRunner(original, coverageModule) {
661
673
  var _a, _b;
662
674
  await ((_a = super.onAfterRun) == null ? void 0 : _a.call(this));
663
675
  const coverage = await ((_b = coverageModule == null ? void 0 : coverageModule.takeCoverage) == null ? void 0 : _b.call(coverageModule));
664
- await rpc().onAfterSuiteRun({ coverage });
676
+ if (coverage)
677
+ await rpc().onAfterSuiteRun({ coverage });
665
678
  }
666
679
  onCollected(files) {
667
680
  return rpc().onCollected(files);
@@ -802,10 +815,10 @@ class BrowserSnapshotEnvironment {
802
815
  return `// Vitest Snapshot v${this.getVersion()}, https://vitest.dev/guide/snapshot.html`;
803
816
  }
804
817
  readSnapshotFile(filepath) {
805
- return rpc().readFile(filepath);
818
+ return rpc().readSnapshotFile(filepath);
806
819
  }
807
820
  saveSnapshotFile(filepath, snapshot) {
808
- return rpc().writeFile(filepath, snapshot, true);
821
+ return rpc().saveSnapshotFile(filepath, snapshot);
809
822
  }
810
823
  resolvePath(filepath) {
811
824
  return rpc().resolveSnapshotPath(filepath);
@@ -814,10 +827,7 @@ class BrowserSnapshotEnvironment {
814
827
  return rpc().resolveSnapshotRawPath(testPath, rawPath);
815
828
  }
816
829
  removeSnapshotFile(filepath) {
817
- return rpc().removeFile(filepath);
818
- }
819
- async prepareDirectory(dirPath) {
820
- await rpc().createDirectory(dirPath);
830
+ return rpc().removeSnapshotFile(filepath);
821
831
  }
822
832
  }
823
833
  function throwNotImplemented(name) {
@@ -21,7 +21,7 @@
21
21
  border: none;
22
22
  }
23
23
  </style>
24
- <script type="module" crossorigin src="/__vitest_browser__/index-76056b5d.js"></script>
24
+ <script type="module" crossorigin src="/__vitest_browser__/index-7726254c.js"></script>
25
25
  </head>
26
26
  <body>
27
27
  <iframe id="vitest-ui" src=""></iframe>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/browser",
3
3
  "type": "module",
4
- "version": "0.34.1",
4
+ "version": "0.34.2",
5
5
  "description": "Browser running for Vitest",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",
@@ -43,10 +43,10 @@
43
43
  "@types/ws": "^8.5.5",
44
44
  "periscopic": "^3.1.0",
45
45
  "rollup": "^3.26.0",
46
- "@vitest/ws-client": "0.34.1",
47
- "@vitest/runner": "0.34.1",
48
- "vitest": "0.34.1",
49
- "@vitest/ui": "0.34.1"
46
+ "vitest": "0.34.2",
47
+ "@vitest/ws-client": "0.34.2",
48
+ "@vitest/ui": "0.34.2",
49
+ "@vitest/runner": "0.34.2"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "rimraf dist && pnpm build:node && pnpm build:client",