From 21e26eb49d6c89aad8330008340d7107ba860b2c Mon Sep 17 00:00:00 2001 From: Etienne Rossignon Date: Wed, 7 Apr 2021 08:33:40 +0200 Subject: [PATCH] skip pnpm tests when nodeversion is < 12 --- test/test-10-pnpm/main.js | 6 ++++++ test/test-11-pnpm/main.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/test/test-10-pnpm/main.js b/test/test-10-pnpm/main.js index 71fe5723d..07c24b816 100644 --- a/test/test-10-pnpm/main.js +++ b/test/test-10-pnpm/main.js @@ -7,6 +7,12 @@ const path = require('path'); const assert = require('assert'); const utils = require('../utils.js'); +// ignore this test if nodejs <= 10 , as recent version of PNPM do not support nodejs=10 +const MAJOR_VERSION = parseInt(process.version.match(/v([0-9]+)/)[1], 10); +if (MAJOR_VERSION < 12) { + return; +} + assert(__dirname === process.cwd()); const target = process.argv[2] || 'host'; diff --git a/test/test-11-pnpm/main.js b/test/test-11-pnpm/main.js index 3912b9018..8e70b5b26 100644 --- a/test/test-11-pnpm/main.js +++ b/test/test-11-pnpm/main.js @@ -7,6 +7,12 @@ const path = require('path'); const assert = require('assert'); const utils = require('../utils.js'); +// ignore this test if nodejs <= 10 , as recent version of PNPM do not support nodejs=10 +const MAJOR_VERSION = parseInt(process.version.match(/v([0-9]+)/)[1], 10); +if (MAJOR_VERSION < 12) { + return; +} + console.log(__dirname, process.cwd()); assert(__dirname === process.cwd());