Skip to content

Commit

Permalink
Update unit test to use arrow functions
Browse files Browse the repository at this point in the history
  • Loading branch information
goetzrrGit committed Nov 21, 2024
1 parent 0c4b6fe commit 2e0da76
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/utilities/codemirror/codemirror-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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' },
Expand Down

0 comments on commit 2e0da76

Please sign in to comment.