diff --git a/docs/__tests__/__snapshots__/index.js.snap b/docs/__tests__/__snapshots__/index.js.snap new file mode 100644 index 000000000..529485449 --- /dev/null +++ b/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", +] +`; diff --git a/docs/__tests__/index.js b/docs/__tests__/index.js new file mode 100644 index 000000000..7cb92c003 --- /dev/null +++ b/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(); +}); diff --git a/package.json b/package.json index c5a07d31b..d9f10c1a2 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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",