From b53f8c982c102429fc8705760e847a585ddf695c Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Wed, 27 Nov 2019 20:53:29 +0400 Subject: [PATCH] Update pathmap generation for roadmap routes --- scripts/path-map.js | 2 -- test/path-map.spec.js | 27 ++------------------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/scripts/path-map.js b/scripts/path-map.js index 87a5d9a11..d2210dad5 100644 --- a/scripts/path-map.js +++ b/scripts/path-map.js @@ -87,8 +87,6 @@ const getRoadmapRoutes = () => { }, {}); }; -console.log(getRoadmapRoutes()); - /** * Generates the path-map understood by next.js * @returns {{}} diff --git a/test/path-map.spec.js b/test/path-map.spec.js index 43b1692b3..47988586c 100644 --- a/test/path-map.spec.js +++ b/test/path-map.spec.js @@ -1,5 +1,6 @@ const path = require('path'); const fs = require('fs'); +const glob = require('glob'); const guides = require('../storage/guides'); const roadmaps = require('../storage/roadmaps'); @@ -57,29 +58,5 @@ describe("Build scripts tests", () => { }) }); - test('it should generate valid roadmap routes', () => { - const expectedPathMap = roadmaps.reduce((roadmapAcc, roadmap) => { - // Routes for each of the versions of this roadmap - const versionRoutes = (roadmap.versions || []).reduce((versionAcc, version) => ({ - ...versionAcc, - [`${roadmap.url}/${version}`]: { - page: '/[roadmap]/[version]', - query: `${roadmap.url.split('/')[1]}/${version}`, - } - }), {}); - - // Route for the route roadmap itself - return { - ...roadmapAcc, - [roadmap.url]: { - page: '/[roadmap]', - query: roadmap.url.split('/')[1] - }, - // Expected roadmap for versions - ...versionRoutes - }; - }, {}); - - expect(getRoadmapRoutes()).toEqual(expectedPathMap); - }) + // @todo add tests for roadmap pathmap });