aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJess <[email protected]>2022-01-30 05:16:45 -0500
committerGitHub <[email protected]>2022-01-30 11:16:45 +0100
commitc9329425faef7d90135471e02aa2d083599bdb94 (patch)
tree14de54c7104763540a8f9c61171874ecc6d2a18e
parent9206e7aded60dd03b54b7dc6e9f8162753013b68 (diff)
downloadfaker-c9329425faef7d90135471e02aa2d083599bdb94.tar.xz
faker-c9329425faef7d90135471e02aa2d083599bdb94.zip
fix: removing toc to fix the docs html (#341)
Co-authored-by: Shinigami <[email protected]>
-rw-r--r--.gitignore3
-rw-r--r--cypress.json1
-rw-r--r--cypress/e2e/smoke.cy.ts25
-rw-r--r--scripts/apidoc.ts2
4 files changed, 24 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index 8acf826f..414655ad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -91,3 +91,6 @@ REVISION
.yarn/
package-lock.json
yarn.lock
+
+cypress/screenshots
+cypress/videos
diff --git a/cypress.json b/cypress.json
index fd984a2b..011099fd 100644
--- a/cypress.json
+++ b/cypress.json
@@ -1,6 +1,7 @@
{
"video": false,
"e2e": {
+ "chromeWebSecurity": false,
"baseUrl": "http://localhost:5000",
"integrationFolder": "cypress/e2e",
"testFiles": "**/*.cy.*",
diff --git a/cypress/e2e/smoke.cy.ts b/cypress/e2e/smoke.cy.ts
index 6b3bc06b..eb3cf1fb 100644
--- a/cypress/e2e/smoke.cy.ts
+++ b/cypress/e2e/smoke.cy.ts
@@ -1,11 +1,26 @@
describe('Smoke Test', () => {
- it('compiles the guide page', () => {
+ beforeEach(() => {
cy.visit('/guide/');
+ cy.get('a[href="/api/animal.html"]').as('firstSectionLink');
+ });
+
+ it('compiles the guide page', () => {
cy.contains('Getting Started');
});
- // it('compiles the playground page', () => {
- // cy.visit('/playground/');
- // cy.contains('Playground under construction');
- // });
+ it('renders this last code example in the code', () => {
+ // Click on any section in the sidebar
+ cy.get('@firstSectionLink')
+ .click()
+ // Make sure the number of code examples is the same between reloads
+ .get('.container pre code')
+ .then(($codeBlocks) => {
+ // Trigger a reload
+ cy.reload()
+ // Give the runtime a chance to update/fail
+ .wait(500)
+ .get('.container pre code')
+ .should('have.length', $codeBlocks.length);
+ });
+ });
});
diff --git a/scripts/apidoc.ts b/scripts/apidoc.ts
index 2d180095..3d972c95 100644
--- a/scripts/apidoc.ts
+++ b/scripts/apidoc.ts
@@ -102,8 +102,6 @@ async function build(): Promise<void> {
<!-- This file is automatically generated. -->
<!-- Run '${scriptCommand}' to update -->
- [[toc]]
-
::: v-pre
${toBlock(module.comment)}