We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c807229 commit cccb1ddCopy full SHA for cccb1dd
e2e/commands/generate.test.js
@@ -0,0 +1,28 @@
1
+const test = require('ava')
2
+const fs = require('fs')
3
+const path = require('path')
4
+
5
+const {run} = require('../helpers/test-utils.js')
6
7
+const genPath = path.join(__dirname, 'generate-cmd')
8
+const docsPath = path.join(genPath, 'docs')
9
10
+test.before('create temp directory', () => {
11
+ // Cleanup if the directory already exists
12
+ if (fs.existsSync(genPath)) {
13
+ fs.rmdirSync(genPath, {recursive: true})
14
+ }
15
16
+ fs.mkdirSync(genPath)
17
+})
18
19
+test.after('cleanup', () => {
20
21
22
23
+test('generate _sidebar.md', t => {
24
+ run(['init', 'docs'], {cwd: genPath})
25
+ run(['generate', 'docs'], {cwd: genPath})
26
+ // Check for existence
27
+ t.true(fs.existsSync(path.join(docsPath, '_sidebar.md')))
28
0 commit comments