@rcompat/test 0.8.2 → 0.8.3

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.
@@ -7,6 +7,7 @@ export default class Assert<const Actual> {
7
7
  get not(): this;
8
8
  equals(expected: unknown): this;
9
9
  nequals(expected: unknown): this;
10
+ includes(expected: unknown): this;
10
11
  type<const Expected extends Equals<Actual, Expected> extends true ? unknown : Print<Actual>>(_expected?: Expected): this;
11
12
  nottype<const Expected extends Not<Equals<Actual, Expected>> extends true ? unknown : "actual and expected types are same">(_expected?: Expected): this;
12
13
  true(): this;
@@ -34,6 +34,16 @@ export default class Assert {
34
34
  this.#report(!equals(this.#actual, expected), expected);
35
35
  return this;
36
36
  }
37
+ includes(expected) {
38
+ const actual = this.#actual;
39
+ const passed = typeof actual === "string"
40
+ ? actual.includes(expected)
41
+ : Array.isArray(actual)
42
+ ? actual.includes(expected)
43
+ : false;
44
+ this.#report(passed, expected);
45
+ return this;
46
+ }
37
47
  type(_expected) {
38
48
  this.pass();
39
49
  return this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rcompat/test",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Standard library testing",
5
5
  "bugs": "https://github.com/rcompat/rcompat/issues",
6
6
  "license": "MIT",