-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(bundle-source): Recognize default metadata (#2379)
Refs: Agoric/agoric-sdk#9735 ## Description Agoric SDK integration revealed a regression in the `bundle-source/cache.js` implementation, where the validator didn’t recognize default metadata. ### Security Considerations None. ### Scaling Considerations None. ### Documentation Considerations None. ### Testing Considerations This change includes a regression test. ### Compatibility Considerations Restores backward compatibility. ### Upgrade Considerations None.
- Loading branch information
Showing
3 changed files
with
22 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import url from 'url'; | ||
import test from '@endo/ses-ava/prepare-endo.js'; | ||
import { makeNodeBundleCache } from '../cache.js'; | ||
|
||
test('cache can capture and verify metadata', async t => { | ||
const dest = url.fileURLToPath(new URL('../bundles/', import.meta.url)); | ||
const entry = url.fileURLToPath( | ||
new URL('../demo/meaning.js', import.meta.url), | ||
); | ||
const cache = await makeNodeBundleCache( | ||
dest, | ||
{}, | ||
specifier => import(specifier), | ||
); | ||
await cache.validateOrAdd(entry, 'cache-test-meaning', t.log); | ||
await cache.validate('cache-test-meaning', undefined, t.log); | ||
t.pass(); | ||
}); |