mirror of
https://github.com/wahyd4/vuepress.git
synced 2026-08-09 05:16:23 +10:00
add test case 1
This commit is contained in:
@@ -0,0 +1 @@
|
||||
dotfile
|
||||
@@ -0,0 +1 @@
|
||||
.dotfolder/foo.txt
|
||||
@@ -0,0 +1 @@
|
||||
bar/foo.txt
|
||||
@@ -0,0 +1 @@
|
||||
foo.txt
|
||||
@@ -0,0 +1 @@
|
||||
bar/baz.txt
|
||||
@@ -0,0 +1 @@
|
||||
baz.txt
|
||||
@@ -0,0 +1 @@
|
||||
readme
|
||||
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* @jest-environment node
|
||||
*/
|
||||
|
||||
const { createApp } = require('@vuepress/core')
|
||||
const { path: { resolve }, fs } = require('@vuepress/shared-utils')
|
||||
|
||||
describe('plugin-public-files: source dir', () => {
|
||||
const app = createApp({
|
||||
sourceDir: resolve(__dirname, 'docs-1')
|
||||
})
|
||||
|
||||
beforeAll(async () => {
|
||||
await app.process()
|
||||
await app.build()
|
||||
}, 60000)
|
||||
|
||||
function testForExistence (name, existence = true) {
|
||||
test(`${existence ? '' : 'in'}existence: ${name}`, () => {
|
||||
expect(fs.existsSync(resolve(app.outDir, name))).toBe(existence)
|
||||
})
|
||||
}
|
||||
|
||||
testForExistence('foo.txt')
|
||||
testForExistence('baz.txt')
|
||||
testForExistence('bar/foo.txt')
|
||||
testForExistence('bar/baz.txt')
|
||||
testForExistence('index.html')
|
||||
testForExistence('readme.md', false)
|
||||
testForExistence('.dotfile', false)
|
||||
testForExistence('.dotfolder', false)
|
||||
})
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vuepress/plugin-public-files",
|
||||
"version": "1.0.0-alpha.44",
|
||||
"version": "1.0.0-alpha.46",
|
||||
"description": "register-global-components plugin for vuepress",
|
||||
"main": "index.js",
|
||||
"publishConfig": {
|
||||
@@ -27,7 +27,8 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vuepress/packages/@vuepress/plugin-public-files#readme",
|
||||
"dependencies": {
|
||||
"@vuepress/shared-utils": "^1.0.0-alpha.44",
|
||||
"@vuepress/core": "^1.0.0-alpha.46",
|
||||
"@vuepress/shared-utils": "^1.0.0-alpha.46",
|
||||
"copy-webpack-plugin": "^5.0.2",
|
||||
"vuepress-mergeable": "^1.0.1"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user