Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.

Commit a48be3c

Browse files
committed
ts: test sync returned records
1 parent 1fd9728 commit a48be3c

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

test/api.types.ts

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {CastingContext, Info, Options, Parser} from '../lib/index'
66

77
describe('API Types', () => {
88

9-
describe('Parser', () => {
9+
describe('stream/callback API', () => {
1010

11-
it('default API, respect parse signature', () => {
11+
it('respect parse signature', () => {
1212
// No argument
1313
parse()
1414
parse("")
@@ -23,14 +23,6 @@ describe('API Types', () => {
2323
parse({})
2424
parse({}, () => {})
2525
})
26-
27-
it('sync API, respect parse signature', () => {
28-
// No argument
29-
parse_sync("")
30-
parse_sync("", {})
31-
parse_sync(Buffer.from(""))
32-
parse_sync(Buffer.from(""), {})
33-
})
3426

3527
it('Expose options', () => {
3628
const parser: Parser = parse()
@@ -69,6 +61,27 @@ describe('API Types', () => {
6961

7062
})
7163

64+
describe('sync api', () => {
65+
66+
it('respect parse signature', () => {
67+
// No argument
68+
parse_sync("")
69+
parse_sync("", {})
70+
parse_sync(Buffer.from(""))
71+
parse_sync(Buffer.from(""), {})
72+
})
73+
74+
it('return records', () => {
75+
try {
76+
const data: object = parse_sync("")
77+
typeof data
78+
}catch (err){
79+
err.message
80+
}
81+
})
82+
83+
})
84+
7285
describe('Info', () => {
7386

7487
const fakeinfo = {

0 commit comments

Comments
 (0)