From 27fc9adf8636d74a52ee344154d116edbd1dddf1 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Sun, 4 Oct 2020 10:40:32 +0530 Subject: [PATCH] tests: cache flags --- scripts/cleanupTest.js | 2 +- test/cache/cache.test.js | 2 +- test/core-flags/cache-flags.test.js | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/cleanupTest.js b/scripts/cleanupTest.js index d7cfe11d6cf..1ad78502622 100644 --- a/scripts/cleanupTest.js +++ b/scripts/cleanupTest.js @@ -12,7 +12,7 @@ const outputDirectories = [ 'test-plugin', 'test-loader', 'test-cache-path', - 'test-locate-path', + 'test-locate-cache', 'stats.json', ]; diff --git a/test/cache/cache.test.js b/test/cache/cache.test.js index 148d9445e80..8eebde0b56a 100644 --- a/test/cache/cache.test.js +++ b/test/cache/cache.test.js @@ -2,7 +2,7 @@ const { run, isWebpack5 } = require('../utils/test-utils'); -describe('bail and watch warning', () => { +describe('cache related tests', () => { it('should log warning in case of single compiler', () => { let { stderr, stdout } = run(__dirname, ['-c', 'webpack.config.js'], false); // run 2nd compilation diff --git a/test/core-flags/cache-flags.test.js b/test/core-flags/cache-flags.test.js index 7f7d447613f..69cfcd29829 100644 --- a/test/core-flags/cache-flags.test.js +++ b/test/core-flags/cache-flags.test.js @@ -1,6 +1,8 @@ 'use strict'; const { run } = require('../utils/test-utils'); +const { existsSync } = require('fs'); +const { resolve } = require('path'); describe('cache related flags from core', () => { it('should be successful with --cache ', () => { @@ -29,6 +31,7 @@ describe('cache related flags from core', () => { expect(stderr).toBeFalsy(); expect(stdout).toContain('test-cache-path'); + expect(existsSync(resolve(__dirname, './test-cache-path'))).toBeTruthy(); }); it('should set cache.cacheLocation with --cache-cache-locations', () => { @@ -36,6 +39,7 @@ describe('cache related flags from core', () => { expect(stderr).toBeFalsy(); expect(stdout).toContain('test-locate-cache'); + expect(existsSync(resolve(__dirname, './test-locate-cache'))).toBeTruthy(); }); it('should set cache.hashAlgorithm with --cache-hash-algorithm', () => {