From a507f51681bec50591f89a67263052431c535b02 Mon Sep 17 00:00:00 2001 From: johnjbarton Date: Mon, 28 Oct 2019 10:53:06 -0700 Subject: [PATCH] test(config): Check for the correct symbolic link before test:client --- test/client/karma.conf.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/client/karma.conf.js b/test/client/karma.conf.js index 6b28de978..853bc2387 100644 --- a/test/client/karma.conf.js +++ b/test/client/karma.conf.js @@ -1,3 +1,5 @@ +const fs = require('fs') + var TRAVIS_WITHOUT_BS = process.env.TRAVIS_SECURE_ENV_VARS === 'false' var launchers = { @@ -43,6 +45,27 @@ var launchers = { } } +// Verify the install. This will run async but that's ok we'll see the log. +fs.lstat('node_modules/karma', (err, stats) => { + if (err) { + console.error('Cannot verify installation', err.stack || err) + } + if (stats && stats.isSymbolicLink()) { + return + } + + console.log('**** Incorrect directory layout for karma self-tests ****') + console.log(` + $ npm install + $ rm -rf node_modules/karma + $ cd node_modules + $ ln -s ../ karma + $ cd ../ + $ grunt browserify + `) + process.exit(1) +}) + var browsers = [] if (process.env.TRAVIS) {