From 385a6c3e88e183c6adee6436e7bbf709c1743450 Mon Sep 17 00:00:00 2001 From: Volker Mische Date: Fri, 9 Mar 2018 18:14:49 +0100 Subject: [PATCH] fix: disable Browser test on Windows `process.platform` is only available in Node.js and not in the Browsers. Hence the `diag.spec.js` tests weren't correctly skipped on Windows. --- package.json | 1 + test/diag.spec.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c30438681..e95bef068 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ }, "devDependencies": { "aegir": "^13.0.6", + "browser-process-platform": "^0.1.1", "chai": "^4.1.2", "cross-env": "^5.1.3", "dirty-chai": "^2.0.1", diff --git a/test/diag.spec.js b/test/diag.spec.js index 216f0ac9a..3a2bb07a5 100644 --- a/test/diag.spec.js +++ b/test/diag.spec.js @@ -5,7 +5,7 @@ const chai = require('chai') const dirtyChai = require('dirty-chai') const expect = chai.expect chai.use(dirtyChai) -const os = require('os') +const platform = require('browser-process-platform') const IPFSApi = require('../src') const f = require('./utils/factory') @@ -14,7 +14,7 @@ describe('.diag', function () { this.timeout(50 * 1000) // go-ipfs does not support these on Windows - if (os.platform() === 'win32') { return } + if (platform === 'win32') { return } let ipfsd let ipfs