Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken functions: negative, positive, min, max, greater, and less #5

Open
WhiteAutumn opened this issue Jun 14, 2021 · 0 comments · May be fixed by #6
Open

Broken functions: negative, positive, min, max, greater, and less #5

WhiteAutumn opened this issue Jun 14, 2021 · 0 comments · May be fixed by #6

Comments

@WhiteAutumn
Copy link

The functions negative, positive, min, max, greater, and less from the file src/plugins/types/number/index.js currently all throw TypeError: service.isNumber is not a function.

Steps to Reproduce

Assuming a new empty directory

  1. Run npm i chai chai-json-pattern
  2. Run the following code:
const { use, expect } = require("chai");
const chaiJsonPattern = require("chai-json-pattern");

use(chaiJsonPattern.default);

expect({ a: 10 }).to.matchPattern(`{ "a": greater(0) }`);

Cause & Fix

The error appears to be caused by the previously mentioned functions trying to call service.isNumber where they should instead call either service.Number or isNumber.

WhiteAutumn added a commit to WhiteAutumn/chai-json-pattern that referenced this issue Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant