UNPKG

818 BJavaScriptView Raw
1"use strict";
2
3var _path = require("path");
4
5var _fs = require("fs");
6
7var _doc = _interopRequireDefault(require("./doc"));
8
9function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
11xdescribe('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