forked from apidoc/apidoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
writer_test.js
51 lines (46 loc) · 1.1 KB
/
writer_test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* apidoc
* https://apidocjs.com
*
* Authors:
* Peter Rottmann <[email protected]>
* Nicolas CARPi @ Deltablot
* Copyright (c) 2013 inveris OHG
* Licensed under the MIT license.
*/
/**
* Test the writer module
*/
const assert = require('assert');
const logger = require('./silentlogger');
const Writer = require('../lib/writer');
describe('test writer module', function () {
it('should work in dry run mode', async function () {
const app = {
options: {
dryRun: true,
},
log: logger,
};
const writer = new Writer({}, app);
return writer.write();
});
it('should work in dry run mode with debug option', async function () {
const app = {
options: {
dryRun: true,
debug: true,
},
log: logger,
};
const writer = new Writer({}, app);
return writer.write();
});
it('getIndexContent() should throw an error if project (apiProject) is undefined', async function () {
const app = {
log: logger,
};
const writer = new Writer({}, app);
assert.throws(writer.getIndexContent, Error);
});
});