From 2e0da766ab40b9d01b888cbc6296d6dff2baebd6 Mon Sep 17 00:00:00 2001 From: rrgoetz Date: Thu, 21 Nov 2024 08:27:32 -1000 Subject: [PATCH] Update unit test to use arrow functions --- src/utilities/codemirror/codemirror-utils.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utilities/codemirror/codemirror-utils.test.ts b/src/utilities/codemirror/codemirror-utils.test.ts index eff2ebdb3f..c3b399ed67 100644 --- a/src/utilities/codemirror/codemirror-utils.test.ts +++ b/src/utilities/codemirror/codemirror-utils.test.ts @@ -92,15 +92,15 @@ describe('quoteEscape', () => { }); }); -describe('parseNumericArg', function () { - it("should parse 'float' and 'numeric' args as floats", function () { +describe('parseNumericArg', () => { + it("should parse 'float' and 'numeric' args as floats", () => { expect(parseNumericArg('1.23', 'float')).toEqual(1.23); expect(parseNumericArg('2.34', 'numeric')).toEqual(2.34); expect(parseNumericArg('bad', 'float')).toEqual(NaN); // can't parse hex numbers as float expect(parseNumericArg('0xabc', 'float')).toEqual(0); }); - it("should parse 'integer' and 'unsigned' args as integers", function () { + it("should parse 'integer' and 'unsigned' args as integers", () => { expect(parseNumericArg('123', 'integer')).toEqual(123); expect(parseNumericArg('234', 'unsigned')).toEqual(234); expect(parseNumericArg('234.567', 'integer')).toEqual(234); @@ -109,8 +109,8 @@ describe('parseNumericArg', function () { expect(parseNumericArg('0x1f', 'unsigned')).toEqual(31); }); }); -describe('isHexValue', function () { - it('should correctly identify a hex number string', function () { +describe('isHexValue', () => { + it('should correctly identify a hex number string', () => { expect(isHexValue('12')).toBe(false); expect(isHexValue('ff')).toBe(false); expect(isHexValue('0x99')).toBe(true); @@ -119,7 +119,7 @@ describe('isHexValue', function () { expect(isHexValue('0x12xx')).toBe(false); }); }); -describe('getDefaultVariableArgs', function () { +describe('getDefaultVariableArgs', () => { const mockParameters = [ { name: 'exampleString', type: 'STRING' }, { allowable_ranges: [{ min: 1.2 }], type: 'FLOAT' },