Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit cfc7340

Browse files
committed
Exercise the Present repository codepath
1 parent 2f979bd commit cfc7340

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

test/models/workdir-context-pool.test.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,9 @@ describe('WorkdirContextPool', function() {
371371

372372
describe('cross-instance cache invalidation', function() {
373373
it('invalidates a config cache key in different instances when a global setting is changed', async function() {
374-
const value = String(Date.now());
374+
const base = String(Date.now());
375+
const value0 = `${base}-0`;
376+
const value1 = `${base}-1`;
375377

376378
const repo0 = pool.add(await cloneRepository('three-files')).getRepository();
377379
const repo1 = pool.add(await cloneRepository('three-files')).getRepository();
@@ -383,17 +385,27 @@ describe('WorkdirContextPool', function() {
383385
[repo0, repo1, repo2].map(repo => repo.getConfig('atomGithub.test')),
384386
);
385387

386-
assert.notInclude([before0, before1, before2], value);
388+
assert.notInclude([before0, before1, before2], value0);
387389

388-
await repo2.setConfig('atomGithub.test', value, {global: true});
390+
await repo2.setConfig('atomGithub.test', value0, {global: true});
389391

390392
const [after0, after1, after2] = await Promise.all(
391393
[repo0, repo1, repo2].map(repo => repo.getConfig('atomGithub.test')),
392394
);
393395

394-
assert.strictEqual(after0, value);
395-
assert.strictEqual(after1, value);
396-
assert.strictEqual(after2, value);
396+
assert.strictEqual(after0, value0);
397+
assert.strictEqual(after1, value0);
398+
assert.strictEqual(after2, value0);
399+
400+
await repo0.setConfig('atomGithub.test', value1, {global: true});
401+
402+
const [final0, final1, final2] = await Promise.all(
403+
[repo0, repo1, repo2].map(repo => repo.getConfig('atomGithub.test')),
404+
);
405+
406+
assert.strictEqual(final0, value1);
407+
assert.strictEqual(final1, value1);
408+
assert.strictEqual(final2, value1);
397409
});
398410
});
399411
});

0 commit comments

Comments
 (0)