Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: feat(config): Use more conventional paths for config and data #5336

Merged
merged 4 commits into from Feb 8, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

it -> test

  • Loading branch information...
Will Binns-Smith
Will Binns-Smith committed Feb 8, 2018
commit ca2f4bd30309e5560d6aa4463648c79c145cc63e
@@ -11,13 +11,13 @@ describe('getDataDir', () => {
mockProcessPlatform('win32');
});

it('uses Yarn/data within LOCALAPPDATA if it exists', () => {
test('uses Yarn/data within LOCALAPPDATA if it exists', () => {
process.env.LOCALAPPDATA = 'foo';
expect(getDataDir()).toBe(path.join('foo', 'Yarn', 'Data'));
delete process.env.LOCALAPPDATA;
});

it('uses AppData\\Local\\Data otherwise', () => {
test('uses AppData\\Local\\Data otherwise', () => {
expect(getDataDir()).toBe(path.join(userHome, 'AppData', 'Local', 'Yarn', 'Data'));
});
});
@@ -27,13 +27,13 @@ describe('getDataDir', () => {
mockProcessPlatform('linux');
});

it('uses XDG_DATA_HOME if it is set', () => {
test('uses XDG_DATA_HOME if it is set', () => {
process.env.XDG_DATA_HOME = 'foo';
expect(getDataDir()).toBe(path.join('foo', 'yarn'));
delete process.env.XDG_DATA_HOME;
});

it('falls back to .local/share/yarn', () => {
test('falls back to .local/share/yarn', () => {
expect(getDataDir()).toBe(path.join(userHome, '.local', 'share', 'yarn'));
});
});
@@ -45,13 +45,13 @@ describe('getCacheDir', () => {
mockProcessPlatform('win32');
});

it('uses Yarn\\Cache within LOCALAPPDATA if it exists', () => {
test('uses Yarn\\Cache within LOCALAPPDATA if it exists', () => {
process.env.LOCALAPPDATA = 'foo';
expect(getCacheDir()).toBe(path.join('foo', 'Yarn', 'Cache'));
delete process.env.LOCALAPPDATA;
});

it('uses AppData\\Local\\Cache otherwise', () => {
test('uses AppData\\Local\\Cache otherwise', () => {
expect(getCacheDir()).toBe(path.join(userHome, 'AppData', 'Local', 'Yarn', 'Cache'));
});
});
@@ -61,13 +61,13 @@ describe('getCacheDir', () => {
mockProcessPlatform('darwin');
});

it('uses XDG_CACHE_HOME if it is set', () => {
test('uses XDG_CACHE_HOME if it is set', () => {
process.env.XDG_CACHE_HOME = 'foo';
expect(getCacheDir()).toBe(path.join('foo', 'yarn'));
delete process.env.XDG_CACHE_HOME;
});

it('falls back to Library/Caches/Yarn', () => {
test('falls back to Library/Caches/Yarn', () => {
expect(getCacheDir()).toBe(path.join(userHome, 'Library', 'Caches', 'Yarn'));
});
});
@@ -77,13 +77,13 @@ describe('getCacheDir', () => {
mockProcessPlatform('linux');
});

it('uses XDG_CACHE_HOME if it is set', () => {
test('uses XDG_CACHE_HOME if it is set', () => {
process.env.XDG_CACHE_HOME = 'foo';
expect(getCacheDir()).toBe(path.join('foo', 'yarn'));
delete process.env.XDG_CACHE_HOME;
});

it('falls back to .cache/yarn', () => {
test('falls back to .cache/yarn', () => {
expect(getCacheDir()).toBe(path.join(userHome, '.cache', 'yarn'));
});
});
@@ -95,13 +95,13 @@ describe('getConfigDir', () => {
mockProcessPlatform('win32');
});

it('uses Yarn\\Config within LOCALAPPDATA if it exists', () => {
test('uses Yarn\\Config within LOCALAPPDATA if it exists', () => {
process.env.LOCALAPPDATA = 'foo';
expect(getConfigDir()).toBe(path.join('foo', 'Yarn', 'Config'));
delete process.env.LOCALAPPDATA;
});

it('uses AppData\\Local\\Config otherwise', () => {
test('uses AppData\\Local\\Config otherwise', () => {
expect(getConfigDir()).toBe(path.join(userHome, 'AppData', 'Local', 'Yarn', 'Config'));
});
});
@@ -111,13 +111,13 @@ describe('getConfigDir', () => {
mockProcessPlatform('linux');
});

it('uses XDG_CONFIG_HOME if it is set', () => {
test('uses XDG_CONFIG_HOME if it is set', () => {
process.env.XDG_CONFIG_HOME = 'foo';
expect(getConfigDir()).toBe(path.join('foo', 'yarn'));
delete process.env.XDG_CONFIG_HOME;
});

it('falls back to .config/yarn', () => {
test('falls back to .config/yarn', () => {
expect(getConfigDir()).toBe(path.join(userHome, '.config', 'yarn'));
});
});
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.