Skip to content

Commit dac0bfe

Browse files
committed
split test into unit and integration
provide some dummy tests cases
1 parent 01ea441 commit dac0bfe

File tree

6 files changed

+62
-2
lines changed

6 files changed

+62
-2
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"dev": "run-p serve watch:*",
2828
"dev:ssr": "run-p serve:ssr watch:*",
2929
"lint": "eslint {src,packages} --fix",
30-
"test": "mocha",
30+
"test": "mocha test/*/**",
3131
"css": "stylus src/themes/*.styl -u autoprefixer-stylus",
3232
"watch:css": "run-p 'css -- -o themes -w'",
3333
"watch:js": "node build/build.js",

Diff for: test/fixtures/simple/README.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Heading
2+
3+
[another page](other.md)
4+
5+
## II 1
6+
7+
### III 1
8+
9+
#### IV 1
10+
11+
##### V 1
12+
13+
14+
## II 2
15+
16+
### III 2
17+
18+
#### IV 2

Diff for: test/fixtures/simple/other-page.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Other
2+
3+
## two 1
4+
5+
### three 1
6+
7+
#### four 1
8+
9+
##### five 1
10+
11+
12+
## two 2
13+
14+
### three 2
15+
16+
#### four 2

Diff for: test/integration/render.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const path = require('path')
2+
3+
const {expect} = require('chai')
4+
5+
const {init, expectSameDom} = require('../_helper')
6+
7+
describe('full docsify initialization', function() {
8+
it('TODO: check generated markup', async function() {
9+
const {docsify, dom} = await init('simple', {loadSidebar: true})
10+
console.log(dom.window.document.body.innerHTML)
11+
})
12+
13+
})

Diff for: test/integration/router.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const path = require('path')
2+
3+
const {expect} = require('chai')
4+
5+
const {init, expectSameDom} = require('../_helper')
6+
7+
describe('router', function() {
8+
it('TODO: trigger to load another page', async function() {
9+
const {docsify} = await init()
10+
window.location = '/?foo=bar'
11+
})
12+
13+
})

Diff for: test/render.js renamed to test/unit/render.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require('path')
22

33
const {expect} = require('chai')
44

5-
const {init, expectSameDom} = require('./_helper')
5+
const {init, expectSameDom} = require('../_helper')
66

77
describe('render', function() {
88
it('important content (tips)', async function() {

0 commit comments

Comments
 (0)