@vitest/expect 0.28.4 → 0.28.5

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 +2 -2
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -865,7 +865,7 @@ const JestChaiExpect = (chai, utils) => {
865
865
  });
866
866
  def("toHaveProperty", function(...args) {
867
867
  if (Array.isArray(args[0]))
868
- args[0] = args[0].map((key) => key.replace(/([.[\]])/g, "\\$1")).join(".");
868
+ args[0] = args[0].map((key) => String(key).replace(/([.[\]])/g, "\\$1")).join(".");
869
869
  const actual = this._obj;
870
870
  const [propertyName, expected] = args;
871
871
  const getValue = () => {
@@ -1119,7 +1119,7 @@ Number of calls: ${c().bold(spy.mock.calls.length)}
1119
1119
  def(["toHaveReturned", "toReturn"], function() {
1120
1120
  const spy = getSpy(this);
1121
1121
  const spyName = spy.getMockName();
1122
- const calledAndNotThrew = spy.mock.calls.length > 0 && !spy.mock.results.some(({ type }) => type === "throw");
1122
+ const calledAndNotThrew = spy.mock.calls.length > 0 && spy.mock.results.some(({ type }) => type !== "throw");
1123
1123
  this.assert(
1124
1124
  calledAndNotThrew,
1125
1125
  `expected "${spyName}" to be successfully called at least once`,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/expect",
3
3
  "type": "module",
4
- "version": "0.28.4",
4
+ "version": "0.28.5",
5
5
  "description": "Jest's expect matchers as a Chai plugin",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -25,8 +25,8 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "chai": "^4.3.7",
28
- "@vitest/spy": "0.28.4",
29
- "@vitest/utils": "0.28.4"
28
+ "@vitest/utils": "0.28.5",
29
+ "@vitest/spy": "0.28.5"
30
30
  },
31
31
  "devDependencies": {
32
32
  "picocolors": "^1.0.0"