Skip to content

Commit

Permalink
Missing assertion + linter
Browse files Browse the repository at this point in the history
  • Loading branch information
PalumboN committed Nov 7, 2023
1 parent 9a57cf8 commit 279e578
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/commands/repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ export function interprete(interpreter: Interpreter, line: string): string {
} catch (error: any) {
return (
error.type === 'ParsimmonError' ? failureDescription(`Syntax error:\n${error.message.split('\n').filter(notEmpty).slice(1).join('\n')}`) :
error instanceof WollokException ? failureDescription('Evaluation Error!', error) :
error instanceof ParseError ? failureDescription(`Syntax Error at offset ${error.sourceMap.start.offset}: ${line.slice(error.sourceMap.start.offset, error.sourceMap.end.offset)}`) :
failureDescription('Uh-oh... Unexpected TypeScript Error!', error)
error instanceof WollokException ? failureDescription('Evaluation Error!', error) :
error instanceof ParseError ? failureDescription(`Syntax Error at offset ${error.sourceMap.start.offset}: ${line.slice(error.sourceMap.start.offset, error.sourceMap.end.offset)}`) :
failureDescription('Uh-oh... Unexpected TypeScript Error!', error)
)
}
}
Expand Down
1 change: 1 addition & 0 deletions test/test.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ describe('Test', () => {
expect(processExitSpy.callCount).to.equal(0)
expect(spyCalledWithSubstring(loggerInfoSpy, 'Running 2 tests')).to.be.true
expect(spyCalledWithSubstring(loggerInfoSpy, '2 passing')).to.be.true
expect(spyCalledWithSubstring(loggerInfoSpy, '0 failing')).to.be.false // old version
})

it('returns exit code 2 if one or more tests fail', async () => {
Expand Down

0 comments on commit 279e578

Please sign in to comment.