Skip to content

Commit

Permalink
fix: contributing build
Browse files Browse the repository at this point in the history
* Always `npm install` samples/package.json before running sample tests
* Copy, rather than symlink, in `test.samples.auth`

Partially fixes googleapis#2377.
  • Loading branch information
elierotenberg committed Oct 1, 2020
1 parent d7a77a5 commit 43deeb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"docs": "node build/src/generator/docs",
"presystem-test": "npm run compile",
"system-test": "mocha build/system-test",
"samples-test": "cd samples && npm link ../ && pwd && npm test",
"samples-test": "cd samples && npm install && npm link ../ && pwd && npm test",
"lint": "gts check",
"compile": "tsc -p .",
"build-tools": "tsc -p tsconfig.tools.json",
Expand Down
3 changes: 2 additions & 1 deletion samples/test/test.samples.auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ describe('Auth samples', () => {
const realPath = path.resolve('jwt.keys.json');
const exists = fs.existsSync(realPath);
if (!exists) {
fs.symlinkSync(fakePath, realPath);
const contents = fs.readFileSync(fakePath);
fs.writeFileSync(realPath, contents);
}
const data = await samples.jwt.runSample();
assert(data);
Expand Down

0 comments on commit 43deeb1

Please sign in to comment.