Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Apr 2, 2024
1 parent fb1b468 commit 428bc17
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { parseDocument } from 'htmlparser2';
import { getWSIBClassificationFromNAICSCode } from './wsibClassifications.js';
export const stripHTML = (rawHTMLString) => {
const cleanString = (rawHTMLString ?? '').trim();
if (cleanString.charAt(0) === '<') {
if (cleanString.startsWith('<')) {
const rawNode = parseDocument(cleanString);
return rawNode.firstChild.children[0].data;
}
Expand Down
2 changes: 1 addition & 1 deletion parsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface ParseValidityPeriodReturn {
export const stripHTML = (rawHTMLString: string): string => {
const cleanString = (rawHTMLString ?? '').trim()

if (cleanString.charAt(0) === '<') {
if (cleanString.startsWith('<')) {
const rawNode = parseDocument(cleanString)
return (
(rawNode.firstChild as unknown as Element).children[0] as unknown as Text
Expand Down
4 changes: 2 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('getClearanceByAccountNumber(validAccountNumber)', () => {
assert.strictEqual(certificate.validityPeriodEnd.constructor, Date);
});
});
describe('getClearanceByAccountNumber(invalidAccountNumber)', async () => {
describe('getClearanceByAccountNumber(invalidAccountNumber)', () => {
let certificate;
before(async () => {
try {
Expand All @@ -53,7 +53,7 @@ describe('getClearanceByAccountNumber(invalidAccountNumber)', async () => {
});
});
describe('getWSIBClassificationFromNAICSCode', () => {
it("Returns { subclassName: 'Hospitals' } on naicsCode = '622000'", async () => {
it("Returns { subclassName: 'Hospitals' } on naicsCode = '622000'", () => {
try {
const result = getWSIBClassificationFromNAICSCode('622000');
assert.strictEqual(result?.subclassName, 'Hospitals');
Expand Down
5 changes: 2 additions & 3 deletions test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ describe('getClearanceByAccountNumber(validAccountNumber)', () => {
})
})

// eslint-disable-next-line @typescript-eslint/no-misused-promises
describe('getClearanceByAccountNumber(invalidAccountNumber)', async () => {
describe('getClearanceByAccountNumber(invalidAccountNumber)', () => {
let certificate: WSIBClearance_Failure

before(async () => {
Expand All @@ -71,7 +70,7 @@ describe('getClearanceByAccountNumber(invalidAccountNumber)', async () => {
})

describe('getWSIBClassificationFromNAICSCode', () => {
it("Returns { subclassName: 'Hospitals' } on naicsCode = '622000'", async () => {
it("Returns { subclassName: 'Hospitals' } on naicsCode = '622000'", () => {
try {
const result = getWSIBClassificationFromNAICSCode('622000')
assert.strictEqual(result?.subclassName, 'Hospitals')
Expand Down

0 comments on commit 428bc17

Please sign in to comment.