| Total Complexity | 6 |
| Complexity/F | 1 |
| Lines of Code | 28 |
| Function Count | 6 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 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 |