mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-04 21:09:21 +08:00
Adding react-docgen for documentation generation
Usage: cd website/react-docgen && npm install or: cd website/react-docgen && npm install -g ./
This commit is contained in:
40
website/react-docgen/lib/utils/__tests__/docblock-test.js
vendored
Normal file
40
website/react-docgen/lib/utils/__tests__/docblock-test.js
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
jest.autoMockOff();
|
||||
|
||||
describe('docblock', function() {
|
||||
|
||||
describe('getDoclets', function() {
|
||||
var getDoclets;
|
||||
|
||||
beforeEach(function() {
|
||||
getDoclets = require('../docblock').getDoclets;
|
||||
});
|
||||
|
||||
it('extacts single line doclets', function() {
|
||||
expect(getDoclets('@foo bar\n@bar baz'))
|
||||
.toEqual({foo: 'bar', bar: 'baz'});
|
||||
});
|
||||
|
||||
it('extacts multi line doclets', function() {
|
||||
expect(getDoclets('@foo bar\nbaz\n@bar baz'))
|
||||
.toEqual({foo: 'bar\nbaz', bar: 'baz'});
|
||||
});
|
||||
|
||||
it('extacts boolean doclets', function() {
|
||||
expect(getDoclets('@foo bar\nbaz\n@abc\n@bar baz'))
|
||||
.toEqual({foo: 'bar\nbaz', abc: true, bar: 'baz'});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user