Skip to content

Commit 7bc6306

Browse files
committed
fix: use Map.get()...
1 parent 8a3e35f commit 7bc6306

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/loader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ internals.createRepositoryLoader = (repository) => {
9393

9494
if (options === undefined && internals.cache.has(url)) {
9595
internals.log('From cache: %s', url);
96-
return internals.cache[url];
96+
return internals.cache.get(url);
9797
}
9898

9999
try {

test/travis.js

+5
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ describe('.travis.yml parsing', () => {
156156
resolved: { '14': '14.3.0' }
157157
}
158158
});
159+
160+
// verify cache returns the same result
161+
const result2 = await NodeSupport.detect({ path: fixture.path });
162+
internals.assertCommit(result2);
163+
expect(result2).to.equal(result);
159164
});
160165

161166
it('resolves and merges (prepend/append)', async () => {

0 commit comments

Comments
 (0)