UNPKG

1 kBJavaScriptView Raw
1/**
2 * Test case for readmeMdBud.
3 * Runs with nodeunit.
4 */
5'use strict'
6
7/* global describe, before, after, it */
8
9const readmeMdBud = require('../lib/readme_md_bud.js')
10const path = require('path')
11
12const coz = require('coz')
13const assert = require('assert')
14const mkdirp = require('mkdirp')
15
16describe('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})