@sprucelabs/schema 28.5.7 → 28.5.8

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.
@@ -1,4 +1,4 @@
1
- import AbstractSpruceTest from '@sprucelabs/test';
1
+ import AbstractSpruceTest from '@sprucelabs/test-utils';
2
2
  import { SchemaRegistry } from '.';
3
3
  export default class AbstractSchemaTest extends AbstractSpruceTest {
4
4
  protected static registry: SchemaRegistry;
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const test_1 = __importDefault(require("@sprucelabs/test"));
6
+ const test_utils_1 = __importDefault(require("@sprucelabs/test-utils"));
7
7
  const _1 = require(".");
8
- class AbstractSchemaTest extends test_1.default {
8
+ class AbstractSchemaTest extends test_utils_1.default {
9
9
  static async beforeEach() {
10
10
  await super.beforeEach();
11
11
  this.registry = _1.SchemaRegistry.getInstance();
@@ -1,4 +1,4 @@
1
- import AbstractSpruceTest from '@sprucelabs/test';
1
+ import AbstractSpruceTest from '@sprucelabs/test-utils';
2
2
  import { SchemaRegistry } from '.';
3
3
  export default class AbstractSchemaTest extends AbstractSpruceTest {
4
4
  protected static registry: SchemaRegistry;
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import AbstractSpruceTest from '@sprucelabs/test';
10
+ import AbstractSpruceTest from '@sprucelabs/test-utils';
11
11
  import { SchemaRegistry } from './index.js';
12
12
  export default class AbstractSchemaTest extends AbstractSpruceTest {
13
13
  static beforeEach() {
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { assert } from '@sprucelabs/test';
10
+ import { assert } from '@sprucelabs/test-utils';
11
11
  import { validationErrorAssert } from '../index.js';
12
12
  import AbstractSchemaTest from '../AbstractSchemaTest.js';
13
13
  import SchemaEntityFactory from '../factories/SchemaEntityFactory.js';
@@ -1,4 +1,4 @@
1
- import { assert } from '@sprucelabs/test';
1
+ import { assert } from '@sprucelabs/test-utils';
2
2
  const selectAssert = {
3
3
  assertSelectChoicesMatch(choices, expected) {
4
4
  assert.isEqual(choices.length, expected.length, `Expected ${expected.length} choices, but found ${choices.length}!`);
@@ -1,4 +1,4 @@
1
- import { assert, assertUtil } from '@sprucelabs/test';
1
+ import { assert, assertUtil } from '@sprucelabs/test-utils';
2
2
  import SpruceError from '../errors/SpruceError.js';
3
3
  function buildFailMessage(code, name, options) {
4
4
  const templates = {
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const test_1 = require("@sprucelabs/test");
6
+ const test_utils_1 = require("@sprucelabs/test-utils");
7
7
  const __1 = require("..");
8
8
  const AbstractSchemaTest_1 = __importDefault(require("../AbstractSchemaTest"));
9
9
  const SchemaEntityFactory_1 = __importDefault(require("../factories/SchemaEntityFactory"));
@@ -17,15 +17,15 @@ class AbstractDateFieldTest extends AbstractSchemaTest_1.default {
17
17
  this.entity.set('optionalBirthday', new Date());
18
18
  }
19
19
  static failsValidationIfPassedString(fieldName, value) {
20
- const err = test_1.assert.doesThrow(() =>
20
+ const err = test_utils_1.assert.doesThrow(() =>
21
21
  //@ts-ignore
22
22
  this.entity.set(fieldName, value));
23
23
  __1.validationErrorAssert.assertError(err, { invalid: [fieldName] });
24
24
  }
25
25
  static honorsRequired() {
26
- test_1.assert.isFalse(this.entity.isValid());
26
+ test_utils_1.assert.isFalse(this.entity.isValid());
27
27
  this.entity.set('requiredBirthday', new Date().getTime());
28
- test_1.assert.isTrue(this.entity.isValid());
28
+ test_utils_1.assert.isTrue(this.entity.isValid());
29
29
  }
30
30
  }
31
31
  exports.default = AbstractDateFieldTest;
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const test_1 = require("@sprucelabs/test");
3
+ const test_utils_1 = require("@sprucelabs/test-utils");
4
4
  const selectAssert = {
5
5
  assertSelectChoicesMatch(choices, expected) {
6
- test_1.assert.isEqual(choices.length, expected.length, `Expected ${expected.length} choices, but found ${choices.length}!`);
6
+ test_utils_1.assert.isEqual(choices.length, expected.length, `Expected ${expected.length} choices, but found ${choices.length}!`);
7
7
  const actualValues = choices.map((c) => c.value);
8
8
  actualValues.sort();
9
9
  expected.sort();
10
- test_1.assert.isEqualDeep(actualValues, expected, `The options you sent don't match!`);
10
+ test_utils_1.assert.isEqualDeep(actualValues, expected, `The options you sent don't match!`);
11
11
  },
12
12
  };
13
13
  exports.default = selectAssert;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const test_1 = require("@sprucelabs/test");
6
+ const test_utils_1 = require("@sprucelabs/test-utils");
7
7
  const SpruceError_1 = __importDefault(require("../errors/SpruceError"));
8
8
  function buildFailMessage(code, name, options) {
9
9
  const templates = {
@@ -11,7 +11,7 @@ function buildFailMessage(code, name, options) {
11
11
  MISSING_PARAMETER: `I found '${name}' even though it should be reported as missing.`,
12
12
  UNEXPECTED_PARAMETER: `I was expecting to unexpectedly find '${name}', but I didn't.`,
13
13
  };
14
- return `${templates[code]}\n\nHere is the error I got: ${test_1.assertUtil.stringify(options)}`;
14
+ return `${templates[code]}\n\nHere is the error I got: ${test_utils_1.assertUtil.stringify(options)}`;
15
15
  }
16
16
  function flattenFields(fieldErrors, flattened, namePrefix = '') {
17
17
  fieldErrors.forEach((err) => {
@@ -65,7 +65,7 @@ const validationErrorAssert = {
65
65
  for (const lookup of (_b = options === null || options === void 0 ? void 0 : options[key]) !== null && _b !== void 0 ? _b : []) {
66
66
  const match = flattened[lookup] === code;
67
67
  if (!match) {
68
- test_1.assert.fail(buildFailMessage(code, lookup, flattened));
68
+ test_utils_1.assert.fail(buildFailMessage(code, lookup, flattened));
69
69
  }
70
70
  }
71
71
  }
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "!build/__tests__",
9
9
  "esm"
10
10
  ],
11
- "version": "28.5.7",
11
+ "version": "28.5.8",
12
12
  "main": "./build/index.js",
13
13
  "types": "./build/index.d.ts",
14
14
  "module": "./build/esm/index.js",
@@ -67,7 +67,7 @@
67
67
  },
68
68
  "dependencies": {
69
69
  "@sprucelabs/error": "^5.0.512",
70
- "@sprucelabs/test": "^7.7.360",
70
+ "@sprucelabs/test-utils": "^3.2.1",
71
71
  "email-validator": "^2.0.4",
72
72
  "just-safe-get": "^4.1.1",
73
73
  "just-safe-set": "^4.1.1"
@@ -78,7 +78,6 @@
78
78
  "@sprucelabs/jest-sheets-reporter": "^1.3.29",
79
79
  "@sprucelabs/resolve-path-aliases": "^1.1.14",
80
80
  "@sprucelabs/semantic-release": "^4.0.8",
81
- "@sprucelabs/test-utils": "^3.2.1",
82
81
  "chokidar-cli": "^3.0.0",
83
82
  "concurrently": "^7.4.0",
84
83
  "eslint": "^8.23.1",