1 | "use strict";
|
2 |
|
3 | var _path = require("path");
|
4 |
|
5 | var _fs = require("fs");
|
6 |
|
7 | var _doc = _interopRequireDefault(require("./doc"));
|
8 |
|
9 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10 |
|
11 | xdescribe('umi-library doc build', () => {
|
12 | process.env.COMPRESS = 'none';
|
13 |
|
14 | require('test-build-result')({
|
15 | root: (0, _path.join)(__dirname, './fixtures/doc'),
|
16 |
|
17 | build({
|
18 | cwd
|
19 | }) {
|
20 | return (0, _doc.default)({
|
21 | cwd,
|
22 | cmd: 'build',
|
23 | params: []
|
24 | }).then(() => {
|
25 | const absDirPath = (0, _path.join)(cwd, '.docz/dist');
|
26 |
|
27 | if ((0, _fs.existsSync)(absDirPath)) {
|
28 | (0, _fs.renameSync)(absDirPath, (0, _path.join)(cwd, 'dist'));
|
29 | } else {
|
30 | throw new Error(`.docz/dist not exists`);
|
31 | }
|
32 | });
|
33 | }
|
34 |
|
35 | });
|
36 | }); |
\ | No newline at end of file |