-
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 case on document has copy in group section
- Loading branch information
Showing
5 changed files
with
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Group Have copy in group section | ||
|
||
this example have a some copy. | ||
|
||
# Case 5 [POST /case/05] | ||
|
||
+ Response 200 (application/json) | ||
|
||
+ Body | ||
|
||
{ | ||
message: "case" | ||
} |
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,34 @@ | ||
/* 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 a some copy in group section', () => { | ||
it('should be enable parse', () => { | ||
const content = load(path.join(__dirname, './docs.apib')) | ||
const result = HarikoParser.parse(content) | ||
assert.deepEqual(result, { | ||
entries: [ | ||
{ | ||
request: { | ||
method: 'POST', | ||
uri: { | ||
path: '/case/05', | ||
template: '/case/05', | ||
queries: [] | ||
} | ||
}, | ||
response: { | ||
statusCode: 200, | ||
headers: [{ name: 'Content-Type', value: 'application/json' }], | ||
body: '{\n message: "case"\n}\n', | ||
data: { message: 'case' } | ||
}, | ||
file: 'case/05-POST.json' | ||
} | ||
], | ||
warnings: [] | ||
}) | ||
}) | ||
}) |