Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(v2): pluginify pages #1278

Merged
merged 2 commits into from
Mar 13, 2019
Merged

feat(v2): pluginify pages #1278

merged 2 commits into from
Mar 13, 2019

Conversation

yangshun
Copy link
Contributor

Motivation

Plugin-ify the pages. The API seems to be fine, I didn't need to change it.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

I updated some of the tests that broke due to the change. Let's also co-locate the tests because eventually we'll shift into packages. Also, it's easier to discover tests when they're right beside the code it's testing.

Related PRs

NA.

@yangshun yangshun requested a review from endiliey as a code owner March 13, 2019 05:04
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Mar 13, 2019

describe('docusaurus-plugin-content-pages', () => {
describe('loadContents', () => {
test.each([
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying out test.each here to reduce repetition. Lemme know if you don't like it. I don't have strong objections against going back to the former approach.

import loadSetup from '../loadSetup';

describe('loadRoutes', () => {
test('simple website', async () => {
const props = await loadSetup('simple');
const {routesPaths} = await loadRoutes(props);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loadSetup() already calls loadRoutes() internally, there's no need to call it again.

@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-preview ready!

Built with commit 11fa7e6

https://deploy-preview-1278--docusaurus-preview.netlify.com

@yangshun yangshun merged commit 398d7c7 into master Mar 13, 2019
@yangshun yangshun deleted the pages branch March 13, 2019 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants