Skip to content

Commit d3b6b98

Browse files
committed
fix lints
1 parent fb5ad18 commit d3b6b98

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

test/rules/currency.spec.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const v = new Validator();
55

66
describe("Test rule: currency", () => {
77
it("should have decimal optional, and correctly placed if present", () => {
8-
const check = v.compile({$$root: true, type: "currency", 'currencySymbol': '$', 'symbolOptional': true});
8+
const check = v.compile({$$root: true, type: "currency", "currencySymbol": "$", "symbolOptional": true});
99
expect(check("$12.2")).toEqual(true);
1010
expect(check("$12,222.2")).toEqual(true);
1111
expect(check("$12,222")).toEqual(true);
@@ -14,7 +14,7 @@ describe("Test rule: currency", () => {
1414
});
1515

1616
it("should check thousand separator placement is correct", () => {
17-
const check = v.compile({$$root: true, type: "currency", 'currencySymbol': '$', 'symbolOptional': true});
17+
const check = v.compile({$$root: true, type: "currency", "currencySymbol": "$", "symbolOptional": true});
1818
expect(check("$12.2")).toEqual(true);
1919
expect(check("$12,222.2")).toEqual(true);
2020
expect(check("$122,222.2")).toEqual(true);
@@ -29,36 +29,36 @@ describe("Test rule: currency", () => {
2929
});
3030

3131
it("should not allow any other currency symbol, other than supplied in schema", () => {
32-
let check = v.compile({$$root: true, type: "currency", 'currencySymbol': '$', 'symbolOptional': false});
32+
let check = v.compile({$$root: true, type: "currency", "currencySymbol": "$", "symbolOptional": false});
3333
expect(check("$12.2")).toEqual(true);
3434
expect(check("#12.2")).toEqual([{"actual": "#12.2", "field": undefined, "message": "The '' must be a valid currency format", "type": "currency"}]);
3535
});
3636

3737
it("should keep currency symbol optional, if symbolOptional is true in schema", () => {
38-
let check = v.compile({$$root: true, type: "currency", 'currencySymbol': '$', 'symbolOptional': true});
38+
let check = v.compile({$$root: true, type: "currency", "currencySymbol": "$", "symbolOptional": true});
3939
expect(check("$12.2")).toEqual(true);
4040
expect(check("12.2")).toEqual(true);
4141
expect(check("#12.2")).toEqual([{"actual": "#12.2", "field": undefined, "message": "The '' must be a valid currency format", "type": "currency"}]
4242
);
4343
});
4444

4545
it("should allow negative currencies", () => {
46-
let check = v.compile({$$root: true, type: "currency", 'currencySymbol': '$', 'symbolOptional': true});
46+
let check = v.compile({$$root: true, type: "currency", "currencySymbol": "$", "symbolOptional": true});
4747
expect(check("-12.2")).toEqual(true);
4848
expect(check("$-12.2")).toEqual(true);
4949
expect(check("-$12.2")).toEqual(true);
5050
expect(check("-$-12.2")).toEqual([{"actual": "-$-12.2", "field": undefined, "message": "The '' must be a valid currency format", "type": "currency"}]);
5151
});
5252

5353
it("should work correctly with supplied thousand and decimal separator", () => {
54-
let check = v.compile({$$root: true, type: "currency", 'currencySymbol': '$', 'symbolOptional': true, 'thousandSeparator':'.', 'decimalSeparator':','});
54+
let check = v.compile({$$root: true, type: "currency", "currencySymbol": "$", "symbolOptional": true, "thousandSeparator":".", "decimalSeparator":","});
5555
expect(check("$12,2")).toEqual(true);
5656
expect(check("$12.222")).toEqual(true);
5757
expect(check("$12.222,2")).toEqual(true);
5858
expect(check("$12,222.2")).toEqual([{"actual": "$12,222.2", "field": undefined, "message": "The '' must be a valid currency format", "type": "currency"}]);
5959
});
6060
it("should work correctly with supplied regex pattern", () => {
61-
let check = v.compile({$$root: true, type: "currency", 'customRegex': /123/g});
61+
let check = v.compile({$$root: true, type: "currency", "customRegex": /123/g});
6262
expect(check("123")).toEqual(true);
6363
expect(check("134")).toEqual([{"actual": "134", "field": undefined, "message": "The '' must be a valid currency format", "type": "currency"}]);
6464
});

test/rules/number.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe("Test rule: number", () => {
3636
expect(check(5)).toEqual(true);
3737
expect(check(8)).toEqual(true);
3838

39-
expect(v.validate(-1, { $$root: true, type: "number", min: 0})).toEqual([{actual: -1, expected: 0, field: undefined, message: "The '' field must be greater than or equal to 0.", type: 'numberMin'}]);
39+
expect(v.validate(-1, { $$root: true, type: "number", min: 0})).toEqual([{actual: -1, expected: 0, field: undefined, message: "The '' field must be greater than or equal to 0.", type: "numberMin"}]);
4040
});
4141

4242
it("check max", () => {

0 commit comments

Comments
 (0)