Skip to content

Commit

Permalink
tests: update cache tests
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Oct 4, 2020
1 parent 955a1b1 commit d15d78a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion scripts/cleanupTest.js
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions test/core-flags/cache-flags.test.js
Expand Up @@ -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');
Expand Down

0 comments on commit d15d78a

Please sign in to comment.