-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f715863
commit 442da6c
Showing
2 changed files
with
31 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,27 @@ | ||
import { parser } from './infoParser.js'; | ||
|
||
describe('info', () => { | ||
it('should handle an info definition', () => { | ||
it('should handle an info definition', async () => { | ||
const str = `info`; | ||
expect(() => { | ||
parser.parse(str); | ||
}).not.toThrow(); | ||
await expect(parser.parse(str)).resolves.not.toThrow(); | ||
}); | ||
|
||
it('should handle an info definition with showInfo', () => { | ||
it('should handle an info definition with showInfo', async () => { | ||
const str = `info showInfo`; | ||
expect(() => { | ||
parser.parse(str); | ||
}).not.toThrow(); | ||
await expect(parser.parse(str)).resolves.not.toThrow(); | ||
}); | ||
|
||
it('should throw because of unsupported info grammar', () => { | ||
it('should throw because of unsupported info grammar', async () => { | ||
const str = `info unsupported`; | ||
expect(() => { | ||
parser.parse(str); | ||
}).toThrow('Parsing failed: unexpected character: ->u<- at offset: 5, skipped 11 characters.'); | ||
await expect(parser.parse(str)).rejects.toThrow( | ||
'Parsing failed: unexpected character: ->u<- at offset: 5, skipped 11 characters.' | ||
); | ||
}); | ||
|
||
it('should throw because of unsupported info grammar', () => { | ||
it('should throw because of unsupported info grammar', async () => { | ||
const str = `info unsupported`; | ||
expect(() => { | ||
parser.parse(str); | ||
}).toThrow('Parsing failed: unexpected character: ->u<- at offset: 5, skipped 11 characters.'); | ||
await expect(parser.parse(str)).rejects.toThrow( | ||
'Parsing failed: unexpected character: ->u<- at offset: 5, skipped 11 characters.' | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters