@vitest/runner 1.0.0-beta.5 → 1.0.0-beta.6

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/index.js +7 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -434,8 +434,12 @@ function createTaskCollector(fn, context) {
434
434
  this.setContext("each", void 0);
435
435
  };
436
436
  };
437
- taskFn.skipIf = (condition) => condition ? test.skip : test;
438
- taskFn.runIf = (condition) => condition ? test : test.skip;
437
+ taskFn.skipIf = function(condition) {
438
+ return condition ? this.skip : this;
439
+ };
440
+ taskFn.runIf = function(condition) {
441
+ return condition ? this : this.skip;
442
+ };
439
443
  taskFn.extend = function(fixtures) {
440
444
  const _context = mergeContextFixtures(fixtures, context);
441
445
  return createTest(function fn2(name, fn2, options) {
@@ -796,7 +800,7 @@ async function runSuite(suite, runner) {
796
800
  failTask(suite.result, e, runner.config.diffOptions);
797
801
  }
798
802
  if (suite.mode === "run") {
799
- if (!hasTests(suite)) {
803
+ if (!runner.config.passWithNoTests && !hasTests(suite)) {
800
804
  suite.result.state = "fail";
801
805
  if (!((_c = suite.result.errors) == null ? void 0 : _c.length)) {
802
806
  const error = processError(new Error(`No test found in suite ${suite.name}`));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/runner",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.5",
4
+ "version": "1.0.0-beta.6",
5
5
  "description": "Vitest test runner",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",
@@ -40,7 +40,7 @@
40
40
  "dependencies": {
41
41
  "p-limit": "^5.0.0",
42
42
  "pathe": "^1.1.1",
43
- "@vitest/utils": "1.0.0-beta.5"
43
+ "@vitest/utils": "1.0.0-beta.6"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "rimraf dist && rollup -c",