Skip to content

Commit

Permalink
build: npm install before running sample tests and avoid symlink in t…
Browse files Browse the repository at this point in the history
…ests (#2378)

* Always `npm install` samples/package.json before running sample tests
* Copy, rather than symlink, in `test.samples.auth`

Partially fixes #2377.

Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com>
Co-authored-by: Justin Beckwith <justin.beckwith@gmail.com>
  • Loading branch information
3 people authored Oct 28, 2020
1 parent f675e7b commit 646053c
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 @@ -25,7 +25,7 @@
"docs2": "npm run docs-extract && npm run docs-md",
"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 646053c

Please sign in to comment.