Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
Add some end to end testing to cover our ass and avoid losing pages
Browse files Browse the repository at this point in the history
Ref #1114

This commit show a bug btw, related to pagination.
  • Loading branch information
MoOx committed Aug 9, 2017
1 parent 8bf1b98 commit d0d2c58
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
22 changes: 22 additions & 0 deletions docs/__tests__/__snapshots__/index.js.snap
@@ -0,0 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`should build docs correctly 1`] = `
Array [
"404.html",
"docs/getting-started/index.html",
"index.html",
"news/2017/06/introducing-1.0.0-alpha/index.html",
"news/after/:after/index.html",
"news/index.html",
"showcase/index.html",
"showcase/tag/blog/index.html",
"showcase/tag/business/index.html",
"showcase/tag/community/index.html",
"showcase/tag/docs/index.html",
"showcase/tag/event/index.html",
"showcase/tag/learning/index.html",
"showcase/tag/multi-languages/index.html",
"showcase/tag/open-source/index.html",
"showcase/tag/service/index.html",
]
`;
12 changes: 12 additions & 0 deletions docs/__tests__/index.js
@@ -0,0 +1,12 @@
import globby from "globby";

it("should build docs correctly", () => {
const testFolder = __dirname + "/../dist";
const files = globby.sync("**/*", {
cwd: testFolder,
nodir: true
});

// should have html files
expect(files.filter(file => file.endsWith(".html"))).toMatchSnapshot();
});
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -26,6 +26,7 @@
"eslint-plugin-react-native": "^2.3.2",
"flow-bin": "^0.47.0",
"git-exec-and-restage": "^1.0.1",
"globby": "^6.1.0",
"husky": "^0.13.3",
"jest": "^20.0.0",
"lerna": "^2.0.0-rc.5",
Expand All @@ -50,9 +51,9 @@
"lint:eslint": "eslint --ignore-path .gitignore --fix packages e2e-tests",
"lint:flow": "flow check",
"lint": "npm-run-all --parallel lint:*",
"tests": "cross-env jest --runInBand --coverage packages",
"tests": "jest --runInBand --coverage packages",
"docs:start": "cd docs && npm start",
"docs:test": "cd docs && npm test",
"docs:test": "cd docs && npm test && jest docs",
"docs:deploy": "cd docs && npm run deploy",
"pretest": "npm run -s transpile && npm run -s lint",
"test": "npm run -s tests",
Expand Down

0 comments on commit d0d2c58

Please sign in to comment.