mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-24 20:17:50 +02:00
feat(v2): pluginify pages (#1278)
* feat(v2): convert pages into a plugin * fix: update tests
This commit is contained in:
parent
2da59ed4af
commit
398d7c7ae4
21 changed files with 287 additions and 257 deletions
|
@ -5,13 +5,11 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import loadRoutes from '@lib/load/routes';
|
||||
import loadSetup from '../loadSetup';
|
||||
|
||||
describe('loadRoutes', () => {
|
||||
test('simple website', async () => {
|
||||
const props = await loadSetup('simple');
|
||||
const {routesPaths} = await loadRoutes(props);
|
||||
const {routesPaths} = await loadSetup('simple');
|
||||
expect(routesPaths.length).toBeGreaterThan(0);
|
||||
expect(routesPaths.sort()).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
|
@ -26,8 +24,7 @@ Array [
|
|||
});
|
||||
|
||||
test('versioned website', async () => {
|
||||
const props = await loadSetup('versioned');
|
||||
const {routesPaths} = await loadRoutes(props);
|
||||
const {routesPaths} = await loadSetup('versioned');
|
||||
expect(routesPaths.length).toBeGreaterThan(0);
|
||||
expect(routesPaths.sort()).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
|
@ -48,8 +45,7 @@ Array [
|
|||
});
|
||||
|
||||
test('versioned & translated website', async () => {
|
||||
const props = await loadSetup('transversioned');
|
||||
const {routesPaths} = await loadRoutes(props);
|
||||
const {routesPaths} = await loadSetup('transversioned');
|
||||
expect(routesPaths.length).toBeGreaterThan(0);
|
||||
expect(routesPaths.sort()).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
|
@ -83,8 +79,7 @@ Array [
|
|||
});
|
||||
|
||||
test('translated website', async () => {
|
||||
const props = await loadSetup('translated');
|
||||
const {routesPaths} = await loadRoutes(props);
|
||||
const {routesPaths} = await loadSetup('translated');
|
||||
expect(routesPaths.length).toBeGreaterThan(0);
|
||||
expect(routesPaths.sort()).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue