From d15d78af4232ddf45a5e4945bf131c36345b61d9 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Sun, 4 Oct 2020 10:32:06 +0530 Subject: [PATCH] tests: update cache tests --- scripts/cleanupTest.js | 13 ++++++++++++- test/core-flags/cache-flags.test.js | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/cleanupTest.js b/scripts/cleanupTest.js index 43ab80577e0..d7cfe11d6cf 100644 --- a/scripts/cleanupTest.js +++ b/scripts/cleanupTest.js @@ -3,7 +3,18 @@ const rimraf = require('rimraf'); const { join } = require('path'); const collectTestFolders = require('./utils'); -const outputDirectories = ['bin', 'binary', 'dist', 'test', 'test-assets', 'test-plugin', 'test-loader', 'stats.json']; +const outputDirectories = [ + 'bin', + 'binary', + 'dist', + 'test', + 'test-assets', + 'test-plugin', + 'test-loader', + 'test-cache-path', + 'test-locate-path', + 'stats.json', +]; function folderStrategy(stats, file) { return stats.isDirectory() && outputDirectories.includes(file); diff --git a/test/core-flags/cache-flags.test.js b/test/core-flags/cache-flags.test.js index c9a3f4bf47f..7f7d447613f 100644 --- a/test/core-flags/cache-flags.test.js +++ b/test/core-flags/cache-flags.test.js @@ -25,14 +25,14 @@ describe('cache related flags from core', () => { }); it('should set cache.cacheDirectory with --cache-cache-directory', () => { - const { stderr, stdout } = run(__dirname, ['--cache-type', 'filesystem', '--cache-cache-directory', '/test-cache-path']); + const { stderr, stdout } = run(__dirname, ['--cache-type', 'filesystem', '--cache-cache-directory', './test-cache-path']); expect(stderr).toBeFalsy(); expect(stdout).toContain('test-cache-path'); }); it('should set cache.cacheLocation with --cache-cache-locations', () => { - const { stderr, stdout } = run(__dirname, ['--cache-type', 'filesystem', '--cache-cache-location', '/test-locate-cache']); + const { stderr, stdout } = run(__dirname, ['--cache-type', 'filesystem', '--cache-cache-location', './test-locate-cache']); expect(stderr).toBeFalsy(); expect(stdout).toContain('test-locate-cache');