1 |
|
2 |
|
3 |
|
4 |
|
5 | 'use strict'
|
6 |
|
7 |
|
8 |
|
9 | const readmeMdBud = require('../lib/readme_md_bud.js')
|
10 | const path = require('path')
|
11 |
|
12 | const coz = require('coz')
|
13 | const assert = require('assert')
|
14 | const mkdirp = require('mkdirp')
|
15 |
|
16 | describe('readme_md_bud', () => {
|
17 | let basedir = path.resolve(__dirname, '..')
|
18 | let tmpDir = path.resolve(basedir, 'tmp/readme_md_bud_test/pkg-foo')
|
19 |
|
20 | before(async () => {
|
21 | mkdirp.sync(tmpDir)
|
22 | })
|
23 |
|
24 | it('Readme md bud', async () => {
|
25 | let bud = readmeMdBud({
|
26 | pkg: {
|
27 | name: 'foo',
|
28 | description: 'This is foo desc.',
|
29 | license: 'MIT'
|
30 | },
|
31 | badges: {
|
32 | travis: true,
|
33 | bower: true
|
34 | },
|
35 | links: {
|
36 | foo: 'http://foo/bar/baz'
|
37 | },
|
38 | repo: 'foo/bar',
|
39 | sections: path.join(basedir, 'doc/mockups/mock-*.md')
|
40 | })
|
41 | bud.path = tmpDir + '/README.md'
|
42 | assert.ok(bud)
|
43 | await coz.render(bud, {
|
44 | cwd: tmpDir
|
45 | })
|
46 | })
|
47 | })
|