Completed
Push — master ( 8c53f9...1d869a )
by Marcelo
33s
created

test/readme.spec.js   A

Complexity

Total Complexity 6
Complexity/F 1

Size

Lines of Code 28
Function Count 6

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 0
wmc 6
c 2
b 0
f 0
nc 1
mnd 0
bc 5
fnc 6
dl 0
loc 28
rs 10
bpm 0.8333
cpm 1
noi 0
1
import { promisify } from 'bluebird';
2
import { expect } from 'chai';
3
import path from 'path';
4
import rimraf from 'rimraf';
5
import { createStream } from './helper';
6
7
const rm = promisify(rimraf);
8
9
describe('readme.js', () => {
10
    before(() => rm('./test/data/hello-world/README.md'));
11
12
    describe('Generation', () => {
13
        it('should generate README for a hello world', () => {
14
            process.chdir(path.join(__dirname, 'data/hello-world'));
15
            const stream = createStream(['readme'], '../../../dist/cli.js');
16
17
            return stream.once('data')
18
                .then(warning => {
19
                    expect(warning).to.match(/generated README.md/);
20
                    expect('README.md').to.be.a.file();
21
                })
22
                .finally(() => {
23
                    stream.close();
24
                    process.chdir(path.join(__dirname, '..'));
25
                });
26
        }).timeout(25000);
27
    });
28
});
29