This repository has been archived by the owner on May 13, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: spread out blog plugin options to theme options
- Loading branch information
1 parent
dd6bb0d
commit ee5101b
Showing
6 changed files
with
1,474 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ module.exports = { | |
root: true, | ||
|
||
env: { | ||
"node": true | ||
"node": true, | ||
"jest": true | ||
}, | ||
|
||
extends: [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`should match snapshot without any configuration 1`] = ` | ||
Object { | ||
"nav": Array [ | ||
Object { | ||
"link": "/", | ||
"text": "Blog", | ||
}, | ||
Object { | ||
"link": "/tag/", | ||
"text": "Tags", | ||
}, | ||
], | ||
"pwa": false, | ||
"summary": true, | ||
"summaryLength": 200, | ||
} | ||
`; | ||
|
||
exports[`should match snapshot without any configuration 2`] = ` | ||
Object { | ||
"alias": Object { | ||
"fonts": "/Users/billy/Desktop/vuepress-projects/vuepress-theme-blog/fonts", | ||
}, | ||
"define": Object { | ||
"THEME_BLOG_PAGINATION_COMPONENT": "Pagination", | ||
}, | ||
"extendPageData": [Function], | ||
"plugins": Array [ | ||
"@vuepress/plugin-nprogress", | ||
Array [ | ||
"@vuepress/medium-zoom", | ||
true, | ||
], | ||
Array [ | ||
"@vuepress/search", | ||
Object { | ||
"searchMaxSuggestions": 10, | ||
}, | ||
], | ||
Array [ | ||
"@vuepress/blog", | ||
Object { | ||
"directories": Array [ | ||
Object { | ||
"dirname": "_posts", | ||
"id": "post", | ||
"path": "/", | ||
}, | ||
], | ||
"frontmatters": Array [ | ||
Object { | ||
"id": "tag", | ||
"keys": Array [ | ||
"tag", | ||
"tags", | ||
], | ||
"path": "/tag/", | ||
}, | ||
], | ||
"globalPagination": Object { | ||
"lengthPerPage": 5, | ||
}, | ||
}, | ||
], | ||
], | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* @jest-environment node | ||
*/ | ||
|
||
const vuepressThemeBlog = require('../') | ||
|
||
test('should be a function', () => { | ||
expect(typeof vuepressThemeBlog).toBe('function') | ||
}) | ||
|
||
test('should match snapshot without any configuration', () => { | ||
const themeConfig = {} | ||
const config = vuepressThemeBlog(themeConfig) | ||
expect(themeConfig).toMatchSnapshot() | ||
expect(config).toMatchSnapshot() | ||
}) |
Oops, something went wrong.