-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hariko-parser): support body content is zero case #20
- Loading branch information
Showing
6 changed files
with
67 additions
and
2 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Group Haven't body contents | ||
|
||
# send post [POST /case/04] | ||
|
||
+ Response 200 (application/json) | ||
+ Body |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* eslint-env mocha */ | ||
import assert = require('assert') | ||
import * as path from 'path' | ||
import * as HarikoParser from '../../../src/hariko-parser' | ||
import { load } from '../../utils/fixture' | ||
|
||
describe('case: have not body contents', () => { | ||
it('should be enable parse', () => { | ||
const content = load(path.join(__dirname, './docs.apib')) | ||
const result = HarikoParser.parse(content) | ||
assert.deepEqual(result, { | ||
entries: [ | ||
{ | ||
file: 'case/04-POST.json', | ||
request: { | ||
method: 'POST', | ||
uri: { | ||
path: '/case/04', | ||
queries: [], | ||
template: '/case/04' | ||
} | ||
}, | ||
response: { | ||
body: '', | ||
data: {}, | ||
headers: [ | ||
{ | ||
name: 'Content-Type', | ||
value: 'application/json' | ||
} | ||
], | ||
statusCode: 200 | ||
} | ||
} | ||
], | ||
warnings: [] | ||
}) | ||
}) | ||
}) |