Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 06c00b5

Browse files
committed
Remove focused tests, add await to exec calls
1 parent edc313d commit 06c00b5

File tree

2 files changed

+8
-25
lines changed

2 files changed

+8
-25
lines changed

test/controllers/file-patch-controller.test.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ describe('FilePatchController', function() {
325325
const workingDirPath = await cloneRepository('symlinks');
326326
const repository = await buildRepository(workingDirPath);
327327

328-
// correctly handle symlinks on Windows
329-
repository.git.exec(['config', 'core.symlinks', 'true']);
328+
// correctly handle symlinks on Windows
329+
await repository.git.exec(['config', 'core.symlinks', 'true']);
330330

331331
const deletedSymlinkAddedFilePath = 'symlink.txt';
332332
fs.unlinkSync(path.join(workingDirPath, deletedSymlinkAddedFilePath));
@@ -389,23 +389,17 @@ describe('FilePatchController', function() {
389389
assert.autocrlfEqual(await repository.readFileFromIndex(deletedFileAddedSymlinkPath), 'foo\n\n');
390390
});
391391

392-
it.only('stages symlink change when staging added lines that depend on change', async function() {
392+
it('stages symlink change when staging added lines that depend on change', async function() {
393393
const workingDirPath = await cloneRepository('symlinks');
394394
const repository = await buildRepository(workingDirPath);
395395

396396
// correctly handle symlinks on Windows
397-
repository.git.exec(['config', 'core.symlinks', 'true']);
397+
await repository.git.exec(['config', 'core.symlinks', 'true']);
398398

399399
const deletedSymlinkAddedFilePath = 'symlink.txt';
400400
fs.unlinkSync(path.join(workingDirPath, deletedSymlinkAddedFilePath));
401401
fs.writeFileSync(path.join(workingDirPath, deletedSymlinkAddedFilePath), 'qux\nfoo\nbar\nbaz\nzoo\n', 'utf8');
402-
403-
console.log(workingDirPath);
404-
debugger;
405-
// cd into directory and view in atom. do hunks show up?
406-
407-
// try adding 'initialStagingStatus: 'unstaged''
408-
402+
409403
const component = createComponent(repository, deletedSymlinkAddedFilePath);
410404
const wrapper = mount(React.cloneElement(component, {filePath: deletedSymlinkAddedFilePath}));
411405

@@ -493,7 +487,7 @@ describe('FilePatchController', function() {
493487
const workingDirPath = await cloneRepository('symlinks');
494488
const repository = await buildRepository(workingDirPath);
495489

496-
repository.git.exec(['config', 'core.symlinks', 'true']);
490+
await repository.git.exec(['config', 'core.symlinks', 'true']);
497491

498492
const deletedSymlinkAddedFilePath = 'symlink.txt';
499493
fs.unlinkSync(path.join(workingDirPath, deletedSymlinkAddedFilePath));

test/models/file-patch.test.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -292,27 +292,16 @@ describe('FilePatch', function() {
292292
});
293293

294294
describe('typechange file patches', function() {
295-
it.only('handles typechange patches for a symlink replaced with a file', async function() {
295+
it('handles typechange patches for a symlink replaced with a file', async function() {
296296
const workdirPath = await cloneRepository('symlinks');
297297
const repository = await buildRepository(workdirPath);
298298

299-
repository.git.exec(['config', 'core.symlinks', 'true']);
299+
await repository.git.exec(['config', 'core.symlinks', 'true']);
300300

301301
const deletedSymlinkAddedFilePath = 'symlink.txt';
302302
fs.unlinkSync(path.join(workdirPath, deletedSymlinkAddedFilePath));
303303
fs.writeFileSync(path.join(workdirPath, deletedSymlinkAddedFilePath), 'qux\nfoo\nbar\n', 'utf8');
304304

305-
console.log(workdirPath);
306-
debugger;
307-
// cd into folder and see what diff looks like
308-
// if not then perhaps symlinks are not being treated correctly on windows.
309-
// is mode changing correctly? should we manually change it?
310-
// should we ignore test? is it even relevant?
311-
// if it matches below there's app logic error
312-
// file isn't being marked as deleted
313-
// header for patch added is missing entirely
314-
// check toString method
315-
316305
const patch = await repository.getFilePatchForPath(deletedSymlinkAddedFilePath);
317306
assert.equal(patch.toString(), dedent`
318307
diff --git a/symlink.txt b/symlink.txt

0 commit comments

Comments
 (0)