Browse Source

Merge pull request #7 from beaussan/fix/tests

 fix tests for git config
pull/8/head
Nicolas Beaussart 6 years ago
committed by GitHub
parent
commit
4074b5ae04
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/tests/add/prettier.spec.ts
  2. 2
      src/tests/add/tailwind.spec.ts
  3. 2
      src/utls/base-add-command.spec.ts

2
src/tests/add/prettier.spec.ts

@ -20,8 +20,10 @@ beforeEach(async () => {
execPath = filesystem.path('/', 'tmp', tmpDirName); execPath = filesystem.path('/', 'tmp', tmpDirName);
filesystem.dir(execPath); filesystem.dir(execPath);
process.chdir(execPath); process.chdir(execPath);
try {
await system.run('git config --global user.email "you@example.com"'); await system.run('git config --global user.email "you@example.com"');
await system.run('git config --global user.name "Your Name"'); await system.run('git config --global user.name "Your Name"');
} catch {}
}); });
afterEach(() => { afterEach(() => {
console.log = originalLog; console.log = originalLog;

2
src/tests/add/tailwind.spec.ts

@ -20,8 +20,10 @@ beforeEach(async () => {
execPath = filesystem.path('/', 'tmp', tmpDirName); execPath = filesystem.path('/', 'tmp', tmpDirName);
filesystem.dir(execPath); filesystem.dir(execPath);
process.chdir(execPath); process.chdir(execPath);
try {
await system.run('git config --global user.email "you@example.com"'); await system.run('git config --global user.email "you@example.com"');
await system.run('git config --global user.name "Your Name"'); await system.run('git config --global user.name "Your Name"');
} catch {}
}); });
afterEach(() => { afterEach(() => {
console.log = originalLog; console.log = originalLog;

2
src/utls/base-add-command.spec.ts

@ -18,8 +18,10 @@ beforeEach(async () => {
execPath = filesystem.path('/', 'tmp', tmpDirName); execPath = filesystem.path('/', 'tmp', tmpDirName);
filesystem.dir(execPath); filesystem.dir(execPath);
process.chdir(execPath); process.chdir(execPath);
try {
await system.run('git config --global user.email "you@example.com"'); await system.run('git config --global user.email "you@example.com"');
await system.run('git config --global user.name "Your Name"'); await system.run('git config --global user.name "Your Name"');
} catch {}
}); });
afterEach(() => { afterEach(() => {
console.log = originalLog; console.log = originalLog;

Loading…
Cancel
Save