diff --git a/lib/fs/__tests__/multi-param.test.js b/lib/fs/__tests__/multi-param.test.js index b23efc07..6b0cccb4 100644 --- a/lib/fs/__tests__/multi-param.test.js +++ b/lib/fs/__tests__/multi-param.test.js @@ -4,13 +4,13 @@ const assert = require('assert') const path = require('path') const crypto = require('crypto') const os = require('os') -const semver = require('semver') +const atLeastNode = require('at-least-node') const fs = require('../..') const SIZE = 1000 // Used for tests on Node 12.9.0+ only -const describeNode12 = semver.gte(process.version, '12.9.0') ? describe : describe.skip +const describeNode12 = atLeastNode('12.9.0') ? describe : describe.skip describe('fs.read()', () => { let TEST_FILE diff --git a/lib/util/__tests__/stat.test.js b/lib/util/__tests__/stat.test.js index df436501..8d0e85de 100644 --- a/lib/util/__tests__/stat.test.js +++ b/lib/util/__tests__/stat.test.js @@ -4,7 +4,7 @@ const fs = require(process.cwd()) const os = require('os') const path = require('path') const assert = require('assert') -const semver = require('semver') +const atLeastNode = require('at-least-node') const stat = require('../stat.js') const NODE_VERSION_WITH_BIGINT = '10.5.0' @@ -23,7 +23,6 @@ describe('util/stat', () => { describe('should use stats with bigint type for node versions >= 10.5.0 and number type for older versions', () => { it('stat.checkPaths()', () => { - const nodeVersion = process.versions.node const src = path.join(TEST_DIR, 'src') const dest = path.join(TEST_DIR, 'dest') fs.ensureFileSync(src) @@ -31,7 +30,7 @@ describe('util/stat', () => { stat.checkPaths(src, dest, 'copy', (err, stats) => { assert.ifError(err) const { srcStat } = stats - if (semver.gte(nodeVersion, NODE_VERSION_WITH_BIGINT)) { + if (atLeastNode(NODE_VERSION_WITH_BIGINT)) { assert.strictEqual(typeof srcStat.ino, 'bigint') } else { assert.strictEqual(typeof srcStat.ino, 'number') @@ -40,13 +39,12 @@ describe('util/stat', () => { }) it('stat.checkPathsSync()', () => { - const nodeVersion = process.versions.node const src = path.join(TEST_DIR, 'src') const dest = path.join(TEST_DIR, 'dest') fs.ensureFileSync(src) fs.ensureFileSync(dest) const { srcStat } = stat.checkPathsSync(src, dest, 'copy') - if (semver.gte(nodeVersion, NODE_VERSION_WITH_BIGINT)) { + if (atLeastNode(NODE_VERSION_WITH_BIGINT)) { assert.strictEqual(typeof srcStat.ino, 'bigint') } else { assert.strictEqual(typeof srcStat.ino, 'number') diff --git a/package.json b/package.json index da59c0aa..20e47623 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,6 @@ "nyc": "^15.0.0", "proxyquire": "^2.0.1", "read-dir-files": "^0.1.1", - "semver": "^5.3.0", "standard": "^14.1.0" }, "main": "./lib/index.js",