From 70965b44e1802ccded0182e8ba7c90df4befb976 Mon Sep 17 00:00:00 2001 From: zkochan Date: Wed, 19 Oct 2016 00:49:43 +0300 Subject: [PATCH] test(install): flat tree throws error on Node.js < 6.3.0 --- test/install.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/install.ts b/test/install.ts index b8faa977f0..910b53fcff 100644 --- a/test/install.ts +++ b/test/install.ts @@ -647,6 +647,22 @@ test('should install flat tree', async function (t) { } }) +test('should throw error when trying to install flat tree on Node.js < 6.3.0', async function (t) { + if (preserveSymlinks) { + t.skip() + return + } + + prepare() + + try { + await installPkgs(['rimraf@2.5.1'], testDefaults({flatTree: true})) + t.fail('installation should have failed') + } catch (err) { + t.equal(err.message, 'Flat tree is supported only on Node.js >= 6.3.0') + } +}) + test('should throw error when trying to install with a different tree type using a dedicated store', async function(t) { if (!preserveSymlinks) { t.skip('flat trees are supported only on Node.js with --preserve-symlinks support')