diff --git a/libs/scully/src/lib/renderPlugins/puppeteerRenderPlugin.ts b/libs/scully/src/lib/renderPlugins/puppeteerRenderPlugin.ts index 8de83371f..13244ca09 100644 --- a/libs/scully/src/lib/renderPlugins/puppeteerRenderPlugin.ts +++ b/libs/scully/src/lib/renderPlugins/puppeteerRenderPlugin.ts @@ -17,13 +17,14 @@ const errorredPages = new Set(); let version = '0.0.0'; try { - version = - jsonc.parse(readFileSync(join(__dirname, '../package.json')).toString()) - .version || '0.0.0'; -} catch { + const pkg = join(__dirname, '../../package.json'); + // console.log(pkg) + version = jsonc.parse(readFileSync(pkg).toString()).version || '0.0.0'; +} catch (e) { // this is only for internals builds // version = jsonc.parse(readFileSync(join(__dirname, '../../../package.json')).toString()).version || '0.0.0'; } +console.log(version); export const puppeteerRender = async (route: HandledRoute): Promise => { const timeOutValueInSeconds = 25; @@ -52,10 +53,12 @@ export const puppeteerRender = async (route: HandledRoute): Promise => { page.on('requestfailed', unRegisterRequest); const requests = new Set(); + // eslint-disable-next-line no-inner-declarations function registerRequest(request) { request.continue(); requests.add(requests); } + // eslint-disable-next-line no-inner-declarations function unRegisterRequest(request) { // request.continue(); requests.delete(requests); diff --git a/tests/jest/src/__tests__/__snapshots__/blog-index.spec.ts.snap b/tests/jest/src/__tests__/__snapshots__/blog-index.spec.ts.snap index be747be96..f12f7afff 100644 --- a/tests/jest/src/__tests__/__snapshots__/blog-index.spec.ts.snap +++ b/tests/jest/src/__tests__/__snapshots__/blog-index.spec.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ContentFolder: Test blog/page-1 Check contentPlugin render 1`] = ` -" +" SampleBlog @@ -17,7 +17,7 @@ exports[`ContentFolder: Test blog/page-1 Check contentPlugin render 1`] = ` } - + Scully demo blog app! rendering inside scully🏠

Scully blog content


@@ -62,7 +62,7 @@ exports[`ContentFolder: Test blog/page-1 Check contentPlugin render 1`] = ` `; exports[`Static: Test blog index Check clean blog index by scully 1`] = ` -" +" SampleBlog @@ -71,7 +71,7 @@ exports[`Static: Test blog index Check clean blog index by scully 1`] = ` - + Scully demo blog app! rendering inside scully🏠

Overview of blog posts

Deeply embedded

11/27/19

This is the deep folder demo page in this sample.

My first page

11/26/19

This is the first demo page in this sample.

My third page

11/28/19

At this point, I should write something different in here.

The Rainbow Cat, A free book out of the Guttenberg library

12/16/19

/blog/page-5

My test sub page

11/27/19

This is the second demo page in this sample.

Made with ❤️ @HeroDevs

diff --git a/tests/jest/src/__tests__/__snapshots__/home.spec.ts.snap b/tests/jest/src/__tests__/__snapshots__/home.spec.ts.snap index 5cf2768d2..8bd0806b6 100644 --- a/tests/jest/src/__tests__/__snapshots__/home.spec.ts.snap +++ b/tests/jest/src/__tests__/__snapshots__/home.spec.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Check list of all Check clean all list from scully 1`] = ` -" +" SampleBlog @@ -10,7 +10,7 @@ exports[`Check list of all Check clean all list from scully 1`] = ` - + Scully demo blog app! rendering inside scully🏠

Available routes

Top level routes onlyUnpublished routes

Made with ❤️ @HeroDevs

diff --git a/tests/jest/src/__tests__/__snapshots__/users.spec.ts.snap b/tests/jest/src/__tests__/__snapshots__/users.spec.ts.snap index 96506ef48..cd5b75aa0 100644 --- a/tests/jest/src/__tests__/__snapshots__/users.spec.ts.snap +++ b/tests/jest/src/__tests__/__snapshots__/users.spec.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`JsonPlugin: test user List Check clean blog index by scully 1`] = ` -" +" SampleBlog @@ -10,7 +10,7 @@ exports[`JsonPlugin: test user List Check clean blog index by scully 1`] = ` - + Scully demo blog app! rendering inside scully🏠

Users

IdUsername
1 Leanne Graham
2 Ervin Howell
3 Clementine Bauch
4 Patricia Lebsack
5 Chelsey Dietrich
6 Mrs. Dennis Schulist
7 Kurtis Weissnat
8 Nicholas Runolfsdottir V
9 Glenna Reichert
10 Clementina DuBuque

Made with ❤️ @HeroDevs

diff --git a/tests/jest/src/test-config.helper.ts b/tests/jest/src/test-config.helper.ts index c47ac9ee1..62d3f4692 100644 --- a/tests/jest/src/test-config.helper.ts +++ b/tests/jest/src/test-config.helper.ts @@ -24,6 +24,7 @@ export const configureTests = ( export const replaceIndexNG = (index: string) => { return index + .replace(/scully-version=[\"\'](.*)[\"\']/gi, '') .replace(/\_ng(content|host)([\-A-Za-z0-9]*)/g, '') .replace(/ng\-version\=\".{5,30}\"/g, '') .replace(/\/\*# sourceMappingURL.*\*\//g, '');