|
1 | 1 | const eol = require('os').EOL;
|
2 | 2 | import * as chai from 'chai';
|
3 |
| -import { temporaryDir, shell, pkg, exists, exec, read, shellAsync } from '../helpers'; |
| 3 | +import { temporaryDir, shell, spawn, exists, read, exec } from '../helpers'; |
4 | 4 |
|
5 | 5 | const expect = chai.expect;
|
6 | 6 | const tmp = temporaryDir();
|
@@ -85,4 +85,43 @@ describe('CLI Additional documentation', () => {
|
85 | 85 | `<li class="link for-chapter3">${eol} <a href="additional-documentation/edition/edition-of-a-todo/edit-level3.html" data-type="entity-link" data-context="sub-entity" data-context-id="additional">edit-level3</a>${eol} </li>${eol} <li class="link for-chapter4">${eol} <a href="additional-documentation/edition/edition-of-a-todo/edit-level3/edit-level4.html" data-type="entity-link" data-context="sub-entity" data-context-id="additional">edit-level4</a>`
|
86 | 86 | );
|
87 | 87 | });
|
| 88 | + |
| 89 | + it('should exit with code 0 if wrong folder provided', () => {}); |
| 90 | +}); |
| 91 | + |
| 92 | +describe('CLI Additional documentation - wrong folder', () => { |
| 93 | + let exitCode = 1; |
| 94 | + |
| 95 | + const distFolder = tmp.name + '-additional-wrong-folder'; |
| 96 | + |
| 97 | + before(done => { |
| 98 | + tmp.create(distFolder); |
| 99 | + const ls = exec( |
| 100 | + 'node' + |
| 101 | + [ |
| 102 | + '', |
| 103 | + './bin/index-cli.js', |
| 104 | + '-p', |
| 105 | + './test/fixtures/todomvc-ng2/src/tsconfig.json', |
| 106 | + '-d', |
| 107 | + distFolder, |
| 108 | + '-a', |
| 109 | + './test/fixtures/todomvc-ng2/screenshots', |
| 110 | + '--includes', |
| 111 | + './test/fixtures/todomvc-ng2/additional-doc-wrong', |
| 112 | + '--includesName', |
| 113 | + '"Additional documentation"' |
| 114 | + ].join(' ') |
| 115 | + ); |
| 116 | + ls.on('close', code => { |
| 117 | + exitCode = code; |
| 118 | + done(); |
| 119 | + }); |
| 120 | + }); |
| 121 | + after(() => tmp.clean(distFolder)); |
| 122 | + |
| 123 | + it('should exit with code 0 if wrong folder provided', () => { |
| 124 | + expect(exitCode).to.equal(0); |
| 125 | + // expect(stderrString).to.contain('Error during Additional documentation generation'); |
| 126 | + }); |
88 | 127 | });
|
0 commit comments