From 52e5fc062b5ff4604cb91e03bcbac61dafce3e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Mon, 3 Aug 2020 15:12:11 +0200 Subject: [PATCH] companion: make npm run test work on windows (#2399) --- packages/@uppy/companion/package.json | 2 +- packages/@uppy/companion/test/run.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 packages/@uppy/companion/test/run.js diff --git a/packages/@uppy/companion/package.json b/packages/@uppy/companion/package.json index e1b4b73ca..d0252ed73 100644 --- a/packages/@uppy/companion/package.json +++ b/packages/@uppy/companion/package.json @@ -86,7 +86,7 @@ "deploy": "kubectl apply -f infra/kube/companion-kube.yml", "prepublishOnly": "npm run build", "start": "node ./lib/standalone/start-server.js", - "test": "bash -c 'npm run build && source env.test.sh && jest'", + "test": "node test/run", "test:watch": "npm test -- --watch" }, "engines": { diff --git a/packages/@uppy/companion/test/run.js b/packages/@uppy/companion/test/run.js new file mode 100644 index 000000000..3e0e0e34b --- /dev/null +++ b/packages/@uppy/companion/test/run.js @@ -0,0 +1,14 @@ +#!/usr/bin/env node +const { execSync } = require('child_process') +const path = require('path') + +process.chdir(path.join(__dirname, '..')) +try { + execSync('jest --version', { shell: 'bash' }) +} catch (err) { + console.error('could not start jest, make sure this script is ran using `npm test`') + process.exit(1) +} + +execSync('npm run build', { stdio: 'inherit' }) +execSync('source env.test.sh && jest', { shell: 'bash', stdio: 'inherit' })