mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-11-30 02:58:37 +08:00
split test into unit and integration
provide some dummy tests cases
This commit is contained in:
parent
01ea44106b
commit
dac0bfec6c
@ -27,7 +27,7 @@
|
||||
"dev": "run-p serve watch:*",
|
||||
"dev:ssr": "run-p serve:ssr watch:*",
|
||||
"lint": "eslint {src,packages} --fix",
|
||||
"test": "mocha",
|
||||
"test": "mocha test/*/**",
|
||||
"css": "stylus src/themes/*.styl -u autoprefixer-stylus",
|
||||
"watch:css": "run-p 'css -- -o themes -w'",
|
||||
"watch:js": "node build/build.js",
|
||||
|
18
test/fixtures/simple/README.md
vendored
Normal file
18
test/fixtures/simple/README.md
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
# Heading
|
||||
|
||||
[another page](other.md)
|
||||
|
||||
## II 1
|
||||
|
||||
### III 1
|
||||
|
||||
#### IV 1
|
||||
|
||||
##### V 1
|
||||
|
||||
|
||||
## II 2
|
||||
|
||||
### III 2
|
||||
|
||||
#### IV 2
|
16
test/fixtures/simple/other-page.md
vendored
Normal file
16
test/fixtures/simple/other-page.md
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
# Other
|
||||
|
||||
## two 1
|
||||
|
||||
### three 1
|
||||
|
||||
#### four 1
|
||||
|
||||
##### five 1
|
||||
|
||||
|
||||
## two 2
|
||||
|
||||
### three 2
|
||||
|
||||
#### four 2
|
13
test/integration/render.js
Normal file
13
test/integration/render.js
Normal file
@ -0,0 +1,13 @@
|
||||
const path = require('path')
|
||||
|
||||
const {expect} = require('chai')
|
||||
|
||||
const {init, expectSameDom} = require('../_helper')
|
||||
|
||||
describe('full docsify initialization', function() {
|
||||
it('TODO: check generated markup', async function() {
|
||||
const {docsify, dom} = await init('simple', {loadSidebar: true})
|
||||
console.log(dom.window.document.body.innerHTML)
|
||||
})
|
||||
|
||||
})
|
13
test/integration/router.js
Normal file
13
test/integration/router.js
Normal file
@ -0,0 +1,13 @@
|
||||
const path = require('path')
|
||||
|
||||
const {expect} = require('chai')
|
||||
|
||||
const {init, expectSameDom} = require('../_helper')
|
||||
|
||||
describe('router', function() {
|
||||
it('TODO: trigger to load another page', async function() {
|
||||
const {docsify} = await init()
|
||||
window.location = '/?foo=bar'
|
||||
})
|
||||
|
||||
})
|
@ -2,7 +2,7 @@ const path = require('path')
|
||||
|
||||
const {expect} = require('chai')
|
||||
|
||||
const {init, expectSameDom} = require('./_helper')
|
||||
const {init, expectSameDom} = require('../_helper')
|
||||
|
||||
describe('render', function() {
|
||||
it('important content (tips)', async function() {
|
Loading…
Reference in New Issue
Block a user