Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add End 2 End tests #477

Merged
merged 9 commits into from
Jul 18, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Scrape e2e repo for urls
  • Loading branch information
Stefan Buck committed Jun 18, 2018
commit 403143cffb0b45962b8fe82c91cae9f5534b9935
21 changes: 21 additions & 0 deletions e2e/scrape-repo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { writeFileSync } = require('fs');
const { join } = require('path');
const fetch = require('node-fetch');

const baseUrl = 'https://github.com/OctoLinker/e2e';

(async function() {
const response = await fetch(
'https://api.github.com/repos/octolinker/e2e/git/trees/master?recursive=1',
);
const json = await response.json();

const content = json.tree
.filter(({ type, path }) => type === 'blob' && path !== 'README.md')
.map(({ path }) => `${baseUrl}/blob/master/${path}`);

writeFileSync(
join(__dirname, '/urls.json'),
JSON.stringify(content, null, ' '),
);
})();
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"lint": "eslint .",
"pretest": "yarn lint",
"test": "jest",
"e2e": "jest --config=e2e/jest-e2e.config.js",
"e2e": "node e2e/scrape-repo.js && jest --config=e2e/jest-e2e.config.js",
"postinstall": "yarn lerna bootstrap",
"test:watch": "jest --watch",
"version": "json -I -f assets/manifest.json -e \"this.version='`json -f package.json version`'\" && git add assets/manifest.json",
Expand Down Expand Up @@ -45,6 +45,7 @@
"json-loader": "^0.5.7",
"lerna": "^2.7.0",
"mkdirp": "^0.5.1",
"node-fetch": "^2.1.2",
"npm-run-all": "^4.1.1",
"prettier": "^1.7.4",
"puppeteer": "^1.5.0",
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6734,6 +6734,10 @@ node-fetch@^1.0.1:
encoding "^0.1.11"
is-stream "^1.0.1"

node-fetch@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5"

node-forge@^0.7.1:
version "0.7.5"
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.7.5.tgz#6c152c345ce11c52f465c2abd957e8639cd674df"
Expand Down