From 43deeb1839285d6af503aa523bf5cc0c28c2ff8e Mon Sep 17 00:00:00 2001 From: Elie Rotenberg Date: Thu, 1 Oct 2020 16:33:29 +0200 Subject: [PATCH] fix: contributing build * Always `npm install` samples/package.json before running sample tests * Copy, rather than symlink, in `test.samples.auth` Partially fixes #2377. --- package.json | 2 +- samples/test/test.samples.auth.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d5e3fa235e..6ce1e43f35 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/samples/test/test.samples.auth.js b/samples/test/test.samples.auth.js index 7656500224..a27538b1d1 100644 --- a/samples/test/test.samples.auth.js +++ b/samples/test/test.samples.auth.js @@ -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);