Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
evansb committed Jun 21, 2017
1 parent 3ba009b commit 72b14d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions packages/toolchain/src/__tests__/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ it('produces a SyntaxError for non ES5 features', () => {

it('detects Missing Semicolon errors', () => {
singleError('1 + 2', {
errorClass: MissingSemicolonError,
explanation: /Missing.*semicolon/
errorClass: MissingSemicolonError
})
})

Expand All @@ -52,17 +51,15 @@ it('detects disallowed feature', () => {
x = 3;
`,
{
errorClass: DisallowedConstructError,
explanation: /Assignment.*not allowed/
errorClass: DisallowedConstructError
}
)
})

it('detects trailing comma', () => {
singleError(`[1,2,];`, {
week: 13,
errorClass: TrailingCommaError,
explanation: /Trailing.*comma/
errorClass: TrailingCommaError
})
})

Expand Down
2 changes: 1 addition & 1 deletion packages/toolchain/src/harness/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const singleError = (source: string, options: Partial<Options>) => {
...defaultOptions,
...options
}
const { errorClass, week, explanation, elaboration } = completeOptions
const { errorClass, week } = completeOptions
const context = runParser(source, week)
expect(context.parser.errors.length).toBe(1)
expect(context.parser.errors[0]).toBeInstanceOf(errorClass)
Expand Down

0 comments on commit 72b14d2

Please sign in to comment.