feat(v2): pluginify pages (#1278)

* feat(v2): convert pages into a plugin

* fix: update tests
This commit is contained in:
Yangshun Tay 2019-03-13 13:08:12 -07:00 committed by GitHub
parent 2da59ed4af
commit 398d7c7ae4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 287 additions and 257 deletions

View file

@ -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 [